Browse Source

add better test for defering reference resolving

pull/16/head v0.1.0
Brett Langdon 11 years ago
parent
commit
1c8c6f315b
2 changed files with 5 additions and 0 deletions
  1. +3
    -0
      forge_test.go
  2. +2
    -0
      test.cfg

+ 3
- 0
forge_test.go View File

@ -20,6 +20,8 @@ primary {
boolean = true; boolean = true;
not_true = FALSE; not_true = FALSE;
nothing = NULL; nothing = NULL;
# Reference secondary._under (which hasn't been defined yet)
sec_ref = secondary._under;
# Primary-sub stuff # Primary-sub stuff
sub { sub {
key = "primary sub key value"; key = "primary sub key value";
@ -58,6 +60,7 @@ func assertDirectives(values map[string]interface{}, t *testing.T) {
assertEqual(primary["boolean"], true, t) assertEqual(primary["boolean"], true, t)
assertEqual(primary["not_true"], false, t) assertEqual(primary["not_true"], false, t)
assertEqual(primary["nothing"], nil, t) assertEqual(primary["nothing"], nil, t)
assertEqual(primary["sec_ref"], int64(50), t)
// Primary Sub // Primary Sub
sub := primary["sub"].(map[string]interface{}) sub := primary["sub"].(map[string]interface{})


+ 2
- 0
test.cfg View File

@ -9,6 +9,8 @@ primary {
boolean = true; boolean = true;
not_true = FALSE; not_true = FALSE;
nothing = NULL; nothing = NULL;
# Reference secondary._under (which hasn't been defined yet)
sec_ref = secondary._under;
# Primary-sub stuff # Primary-sub stuff
sub { sub {
key = "primary sub key value"; key = "primary sub key value";


Loading…
Cancel
Save