Skip to content

Commit

Permalink
fixed cli_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
texadactyl committed Oct 24, 2024
1 parent 1545f7f commit dba154c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/jvm/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"jacobin/globals"
"jacobin/log"
"os"
"path/filepath"
"strings"
"testing"
)
Expand Down Expand Up @@ -186,7 +187,8 @@ func TestInvalidTraceSelection(t *testing.T) {
_, werr, _ := os.Pipe()
os.Stderr = werr

args := []string{"jacobin", "-trace=inst:class:mickey"}
options := "-trace=inst" + string(filepath.ListSeparator) + "class" + string(filepath.ListSeparator) + "mickey"
args := []string{"jacobin", options}
err = HandleCli(args, &global)

_ = werr.Close()
Expand All @@ -195,7 +197,7 @@ func TestInvalidTraceSelection(t *testing.T) {
os.Stderr = normalStderr

if err == nil {
t.Error("-trace=inst:class:mickey failed to generate the expected error")
t.Errorf("%s failed to generate the expected error", options)
}
t.Logf("HandleCli err: %v\n", err)
}
Expand All @@ -214,7 +216,8 @@ func TestValidTraceSelection(t *testing.T) {
_, werr, _ := os.Pipe()
os.Stderr = werr

args := []string{"jacobin", "-trace=inst:class"}
options := "-trace=inst" + string(filepath.ListSeparator) + "class" + string(filepath.ListSeparator) + "inst"
args := []string{"jacobin", options}
err = HandleCli(args, &global)

_ = werr.Close()
Expand Down

0 comments on commit dba154c

Please sign in to comment.