Skip to content

Commit

Permalink
test: Check that string literal fields work in semantic analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Westerlind committed Apr 12, 2022
1 parent 9510b36 commit 9796261
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libflux/flux-core/src/parser/tests/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,8 @@ fn test_parse_record_type_string_literal_property() {
],
},
)
"#]].assert_debug_eq(&parsed);
"#]]
.assert_debug_eq(&parsed);
}

#[test]
Expand Down
15 changes: 15 additions & 0 deletions libflux/flux-core/src/semantic/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2817,6 +2817,21 @@ fn record_with_scoped_labels() {
}
}

#[test]
fn record_with_literal_fields() {
test_infer! {
env: map![
"r" => r##"{ "with spaces": int, "#$%": string }"##,
],
src: r##"
o = {x: r["with spaces"], y: r["#$%"]}
"##,
exp: map![
"o" => "{x: int , y: string}",
],
}
}

#[test]
fn pseudo_complete_query() {
// TODO(algow): re-introduce equality constraints for binary comparison operators
Expand Down

0 comments on commit 9796261

Please sign in to comment.