From fc0e142b2e6c23d6cd66db923eb58ac571e4c8ba Mon Sep 17 00:00:00 2001 From: Johannes Drummer Date: Sat, 24 Aug 2024 18:31:25 +0200 Subject: [PATCH 1/2] fix: broken TestHardcodedIncludeDirectiveDDOS2 on windows --- internal/seclang/parser_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/seclang/parser_test.go b/internal/seclang/parser_test.go index c5000ccd1..061dc985c 100644 --- a/internal/seclang/parser_test.go +++ b/internal/seclang/parser_test.go @@ -169,6 +169,7 @@ func TestHardcodedIncludeDirectiveDDOS2(t *testing.T) { if err != nil { t.Fatal(err) } + tmpFile2.Close() w := bufio.NewWriter(tmpFile) for i := 0; i < maxIncludeRecursion+1; i++ { From 87ddf45a659250c4ce0a9c313bc5b8d63d8c832f Mon Sep 17 00:00:00 2001 From: Johannes Drummer Date: Tue, 27 Aug 2024 09:02:14 +0200 Subject: [PATCH 2/2] fix: error checking in TestHardcodedIncludeDirectiveDDOS2 --- internal/seclang/parser_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/seclang/parser_test.go b/internal/seclang/parser_test.go index 061dc985c..b03ce1fc8 100644 --- a/internal/seclang/parser_test.go +++ b/internal/seclang/parser_test.go @@ -169,7 +169,10 @@ func TestHardcodedIncludeDirectiveDDOS2(t *testing.T) { if err != nil { t.Fatal(err) } - tmpFile2.Close() + err = tmpFile2.Close() + if err != nil { + t.Fatal(err) + } w := bufio.NewWriter(tmpFile) for i := 0; i < maxIncludeRecursion+1; i++ {