From f77f341c3db644952c41065abe22e79b1a3304ef Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Mon, 12 Feb 2024 14:47:09 -0500 Subject: [PATCH] Add test cases for formatting nil type as Void --- analyzer/type_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/analyzer/type_test.go b/analyzer/type_test.go index 603ae22..ee3ff26 100644 --- a/analyzer/type_test.go +++ b/analyzer/type_test.go @@ -162,3 +162,19 @@ testString (test, Bird: (~ [fly] [land]) `) } + +func TestTypeIntegerLiteralVoid (test *testing.T) { +testStringErr (test, +"cannot use integer literal as Void", 2, 10, +` +[main] = 5 +`) +} + +func TestTypeStringLiteralVoid (test *testing.T) { +testStringErr (test, +"cannot use string literal as Void", 2, 10, +` +[main] = 'hello' +`) +}