Skip to content

Commit

Permalink
Add tests for fieldsOf
Browse files Browse the repository at this point in the history
  • Loading branch information
yannham committed Oct 16, 2020
1 parent 18d75d7 commit 7e39939
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1253,4 +1253,15 @@ Assume(#alwaysTrue -> #alwaysFalse, not ) true
assert_npeq!("{ a = \"a\"; b = true }", "{ a = true; b = \"a\"}");
assert_npeq!("{ a = { a = true } }", "{a = { a = { a = true } } }");
}

#[test]
fn fields_of() {
assert_peq!("fieldsOf {}", "[]");
assert_peq!("fieldsOf {a = 1; b = 2; c = 3}", "[\"a\", \"b\", \"c\"]");
assert_peq!("fieldsOf {aAa = 1; Zzz = 2;}", "[\"Zzz\", \"aAa\"]");
assert_peq!(
"fieldsOf {foo = {bar = 0}; baz = Default(true)}",
"[\"baz\", \"foo\"]"
);
}
}

0 comments on commit 7e39939

Please sign in to comment.