From ba5dc76509d7effd8e1fb2b71f454596336c9774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Barzowski?= Date: Fri, 14 May 2021 20:59:33 +0200 Subject: [PATCH] Stop depending on nil vs empty slice in a test. It should not make the difference. --- internal/program/static_analyzer_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/program/static_analyzer_test.go b/internal/program/static_analyzer_test.go index fae4623..88b5267 100644 --- a/internal/program/static_analyzer_test.go +++ b/internal/program/static_analyzer_test.go @@ -28,7 +28,7 @@ func TestSimpleNull(t *testing.T) { if err != nil { t.Errorf("Unexpected error: %+v", err) } - if ast.FreeVariables() != nil { + if len(ast.FreeVariables()) != 0 { t.Errorf("Unexpected free variabled %+v", ast.FreeVariables()) } } @@ -60,7 +60,7 @@ func TestSimpleLocal(t *testing.T) { if err != nil { t.Errorf("Unexpected error: %+v", err) } - if node.FreeVariables() != nil { + if len(node.FreeVariables()) != 0 { t.Errorf("Unexpected free variables %+v in root local. Expected none.", node.FreeVariables()) } returned := node.Body.FreeVariables()