Skip to content

Commit

Permalink
test: add relative import in override file API (#335)
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy authored Jun 24, 2024
1 parent f537301 commit 118aeb8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Empty file added pkg/tools/override/kcl.mod
Empty file.
7 changes: 7 additions & 0 deletions pkg/tools/override/override_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ func TestOverrideFile(t *testing.T) {
t.Fatal(err)
}
}

func TestOverrideFileWithRelativeImport(t *testing.T) {
_, err := OverrideFile("./testdata/test_with_relative_import.k", []string{"config.replicas=1"}, []string{})
if err != nil {
t.Fatal(err)
}
}
1 change: 1 addition & 0 deletions pkg/tools/override/testdata/pkg/pkg.k
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a = 1
6 changes: 6 additions & 0 deletions pkg/tools/override/testdata/test_with_relative_import.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import .pkg

config = {
a = pkg.a
replicas: 1
}

0 comments on commit 118aeb8

Please sign in to comment.