Skip to content

Commit

Permalink
fix: fix unit test
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe committed Nov 8, 2024
1 parent 8afe80d commit 9915b0c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/options/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ spec:

func TestRunOptions_Complete(t *testing.T) {
options := NewRunOptions()
args := []string{"file1.k", "file2.k", "file3.k"}
args := []string{"./testdata/run_opt/file1.k", "./testdata/run_opt/file2.k", "./testdata/run_opt/file3.k"}

err := options.Complete(args)
if err != nil {
t.Errorf("RunOptions.Complete() failed: %v", err)
}

expectedEntries := []string{"file1.k", "file2.k", "file3.k"}
expectedEntries := []string{"./testdata/run_opt/file1.k", "./testdata/run_opt/file2.k", "./testdata/run_opt/file3.k"}

if len(options.Entries) != len(expectedEntries) {
t.Fatalf("unexpected number of entries:\nexpected: %d\ngot: %d", len(expectedEntries), len(options.Entries))
Expand Down
1 change: 1 addition & 0 deletions pkg/options/testdata/run_opt/file1.k
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file1 = 1
1 change: 1 addition & 0 deletions pkg/options/testdata/run_opt/file2.k
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file2 = 2
1 change: 1 addition & 0 deletions pkg/options/testdata/run_opt/file3.k
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file3 = 3

0 comments on commit 9915b0c

Please sign in to comment.