Skip to content

Commit

Permalink
chore: In integration setupGnolandTestScript, use strconv.Unquote on …
Browse files Browse the repository at this point in the history
…args

Signed-off-by: Jeff Thompson <jeff@thefirst.org>
  • Loading branch information
jefft0 committed Mar 5, 2024
1 parent 83d99a2 commit 2f78ae2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion gno.land/pkg/integration/testing_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,17 @@ func setupGnolandTestScript(t *testing.T, txtarDir string) testscript.Params {
logger := ts.Value(envKeyLogger).(*slog.Logger) // grab logger
sid := ts.Getenv("SID") // grab session id

var err error
for i, arg := range args {
if len(arg) < 2 || !strings.HasPrefix(arg, `"`) || !strings.HasSuffix(arg, `"`) {
continue
}

if args[i], err = strconv.Unquote(arg); err != nil {
ts.Fatalf("unable to unquote %s: %w ", arg, err)
}
}

// Setup IO command
io := commands.NewTestIO()
io.SetOut(commands.WriteNopCloser(ts.Stdout()))
Expand Down Expand Up @@ -250,7 +261,7 @@ func setupGnolandTestScript(t *testing.T, txtarDir string) testscript.Params {
// user provided.
args = append(defaultArgs, args...)

err := cmd.ParseAndRun(context.Background(), args)
err = cmd.ParseAndRun(context.Background(), args)

tsValidateError(ts, "gnokey", neg, err)
},
Expand Down

0 comments on commit 2f78ae2

Please sign in to comment.