Add test for double def

This commit is contained in:
Jakub Žádník 2021-10-02 00:17:02 +03:00
parent fb0f83e574
commit 2c1b074bdc

View file

@ -447,6 +447,14 @@ fn hide_twice_not_allowed() -> TestResult {
)
}
#[test]
fn def_twice_should_fail() -> TestResult {
fail_test(
r#"def foo [] { "foo" }; def foo [] { "bar" }"#,
"defined more than once",
)
}
#[test]
fn from_json_1() -> TestResult {
run_test(r#"('{"name": "Fred"}' | from json).name"#, "Fred")