Skip to content

Commit

Permalink
fix tinygo
Browse files Browse the repository at this point in the history
  • Loading branch information
M4tteoP committed Nov 12, 2024
1 parent 753bf43 commit c26e60f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/seclang/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package seclang
import (
"bufio"
"embed"
"errors"
"fmt"
"io/fs"
"os"
Expand Down Expand Up @@ -119,12 +118,13 @@ func TestLoadConfigurationFileWithMultiFs(t *testing.T) {
}

err = p.FromFile("../doesnotexist.conf")
if !strings.Contains(err.Error(), "no such file or directory") && !errors.Is(err, fs.ErrNotExist) {
// Go and TinyGo have different error messages
if !strings.Contains(err.Error(), "no such file or directory") && !strings.Contains(err.Error(), "file does not exist") {
t.Errorf("expected not found error. Got: %s", err.Error())
}

err = p.FromFile("/tmp/doesnotexist.conf")
if !strings.Contains(err.Error(), "no such file or directory") && !errors.Is(err, fs.ErrNotExist) {
if !strings.Contains(err.Error(), "no such file or directory") && !strings.Contains(err.Error(), "file does not exist") {
t.Errorf("expected not found error. Got: %s", err.Error())
}

Expand Down

0 comments on commit c26e60f

Please sign in to comment.