From 2c1b074bdc72aec60f29fe962525fd24b895d92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BD=C3=A1dn=C3=ADk?= Date: Sat, 2 Oct 2021 00:17:02 +0300 Subject: [PATCH] Add test for double def --- src/tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests.rs b/src/tests.rs index c947d1a22..056cac1a9 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -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")