Home

ffdhall @main - refs - log -
-
https://git.jolheiser.com/ffdhall.git
dhall parser for peterbourgon/ff
tree log patch
test: add typed dhall Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmZegY0ACgkQuFOtpdp7 v3qFYBAAuBdPPrgeqT9RNDifp69Yo4HY2Yu3RDro0gHPwUEr/V4C2UAp4HzFFf9e AtFg+KnyT+CToCVNhD7g/UbfEqMCU/WvD1scdnXDJ7H4AaZPZ8ko6q59RZcz3pke bTQXfPcoZnd/JULAO6bCeKHpoGuqs1cpiyyvmTEoOB2zBaGZo3e7MHKcuvpsypa8 vc9erSdDO4+jj9f8Oh5ypXGjvKdZLvrdxmu/UEqW0qwqep/Mb8nqAUv8iJsMK2jQ qb0rUvmXDeMjNH9KH2K9MQ1VrNauRgFK9fKa7RFX9hkweOFcHJAo1IXHtrekZNJR w1okUfB3lOifGPIPNwwnkkt6uqU8PWUrTZfJGIKZOUFfJdqN6gwBGU/UpyoGSa8a h4yMgxLcrPmyaX+5TA3lBsnfBOgNy4vCubTiG709hsSrse40EQKExtzdVaHsLSMX X3TO7+SCNUoW98ELiKBLCnImGFEqDjPVadgji8OSJuc0iMLLCGK74C/3Y9dmsm0r ZQkmonFGTIV+HSUkRnXCAJSeVUfcpgEt5W9hiKv/sMv0vNsZXDF70hhrbWGpP+zB Ru598OJyZFfRMszB8ACZxETWKbrwe+BYzLaN0uaOR4ZY1TxPpztKddY4pwcbq/RH Us/aHaXaB1aBFMU1AUV7ePTSMIfet0Umz29Y1MEkeHN4KVSK4DE= =SVw4 -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
6 months ago
3 changed files, 10 additions(+), 3 deletions(-)
M ffdhall_test.go -> ffdhall_test.go
diff --git a/ffdhall_test.go b/ffdhall_test.go
index f1dfbec7b9ab438c4b6247da64aa5a72ce1b42fc..43e75413672baccf24da01c5b488fc071b6b94d6 100644
--- a/ffdhall_test.go
+++ b/ffdhall_test.go
@@ -1,7 +1,6 @@
 package ffdhall
 
 import (
-	"fmt"
 	"testing"
 	"time"
 
@@ -31,6 +30,12 @@ 			file: "testdata/basic.dhall",
 			want: fftest.Vars{S: "s", I: 10, B: true, D: 5 * time.Second},
 		},
 		{
+			name: "typed KV pairs",
+			args: []string{},
+			file: "testdata/typed.dhall",
+			want: fftest.Vars{S: "s", I: 10, B: true, D: 5 * time.Second},
+		},
+		{
 			name: "value arrays",
 			args: []string{},
 			file: "testdata/value_arrays.dhall",
@@ -49,7 +54,6 @@ 			vars.ParseError = ff.Parse(fs, testcase.args,
 				ff.WithConfigFile(testcase.file),
 				ff.WithConfigFileParser(DhallParser),
 			)
-			fmt.Println(vars.ParseError)
 			fftest.Compare(t, &testcase.want, vars)
 		})
 	}
I testdata/typed.dhall
diff --git a/testdata/typed.dhall b/testdata/typed.dhall
new file mode 100644
index 0000000000000000000000000000000000000000..b9fe64b0e76fb4da60f4835bf0084addffa795f8
--- /dev/null
+++ b/testdata/typed.dhall
@@ -0,0 +1,3 @@
+let Test = { s : Text, i : Natural, b : Bool, d : Text }
+
+in  { s = "s", i = 10, b = True, d = "5s" } : Test
M testdata/value_arrays.dhall -> testdata/value_arrays.dhall
diff --git a/testdata/value_arrays.dhall b/testdata/value_arrays.dhall
index 496e20390cf0b9f2c2ae6bc57b4bbc26be4351bd..2e0b106c5bc11be95966f76429dd8038c64eddb1 100644
--- a/testdata/value_arrays.dhall
+++ b/testdata/value_arrays.dhall
@@ -1,5 +1,5 @@
 { s = [ "a", "bb" ]
-, i = [ "10", "11", "12" ]
+, i = [ 10, 11, 12 ]
 , b = [ False, True ]
 , d = [ "10m", "5s" ]
 , x = [ "a", "B", "👍" ]