From 4e02c452dc44f901a03e3c548a0e579f083f935a Mon Sep 17 00:00:00 2001 From: Lucas Leblow Date: Thu, 28 Oct 2021 02:18:38 -0600 Subject: [PATCH] test: add match given-away value error test (#1351) --- .../match-given-away-value.carp.output.expected | 1 + test/test-for-errors/match-given-away-value.carp | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 test/output/test/test-for-errors/match-given-away-value.carp.output.expected create mode 100644 test/test-for-errors/match-given-away-value.carp diff --git a/test/output/test/test-for-errors/match-given-away-value.carp.output.expected b/test/output/test/test-for-errors/match-given-away-value.carp.output.expected new file mode 100644 index 00000000..da467a27 --- /dev/null +++ b/test/output/test/test-for-errors/match-given-away-value.carp.output.expected @@ -0,0 +1 @@ +match-given-away-value.carp:9:16 Referencing a given-away value 'e'. diff --git a/test/test-for-errors/match-given-away-value.carp b/test/test-for-errors/match-given-away-value.carp new file mode 100644 index 00000000..11772e21 --- /dev/null +++ b/test/test-for-errors/match-given-away-value.carp @@ -0,0 +1,9 @@ +(Project.config "file-path-print-length" "short") + +(deftype Example (A [String String])) + +(defn f [] + (let-do [e (Example.A @"x" @"y")] + (match e + (Example.A a b) ()) + (println* &e)))