Skip to content

Commit

Permalink
fix: fix windows case
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <zongzhe1024@163.com>
  • Loading branch information
zong-zhe committed Nov 13, 2023
1 parent 585e50f commit 6ff8bca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"log"
"os"
"path/filepath"
"strings"
"testing"

"github.com/otiai10/copy"
Expand Down Expand Up @@ -711,15 +712,15 @@ func TestUpdateWithKclMod(t *testing.T) {
expected_content, err := os.ReadFile(expected_path)

assert.Equal(t, err, nil)
assert.Equal(t, string(got_content), string(expected_content))
expect := strings.ReplaceAll(string(expected_content), "\r\n", "\n")
assert.Equal(t, string(got_content), expect)

defer func() {
err := os.RemoveAll(dest_testDir)
assert.Equal(t, err, nil)
}()
}


func TestUpdateWithKclModlock(t *testing.T) {
kpmcli, err := NewKpmClient()
assert.Equal(t, err, nil)
Expand Down Expand Up @@ -748,4 +749,4 @@ func TestUpdateWithKclModlock(t *testing.T) {
err := os.RemoveAll(dest_testDir)
assert.Equal(t, err, nil)
}()
}
}
2 changes: 1 addition & 1 deletion test/e2e/kpm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ var _ = ginkgo.Describe("Kpm CLI Testing", func() {
gomega.Expect(manifest_expect.Annotations[constants.DEFAULT_KCL_OCI_MANIFEST_NAME]).To(gomega.Equal("kcl2"))
gomega.Expect(manifest_expect.Annotations[constants.DEFAULT_KCL_OCI_MANIFEST_VERSION]).To(gomega.Equal("0.0.1"))
gomega.Expect(manifest_expect.Annotations[constants.DEFAULT_KCL_OCI_MANIFEST_DESCRIPTION]).To(gomega.Equal("This is the kcl package named kcl2"))
gomega.Expect(manifest_expect.Annotations[constants.DEFAULT_KCL_OCI_MANIFEST_SUM]).To(gomega.Equal("zQ7PTOcJi4gzXqypCWML6bsjToQU+E9Q2WZw/N3WnNY="))
gomega.Expect(manifest_expect.Annotations[constants.DEFAULT_KCL_OCI_MANIFEST_SUM]).To(gomega.Equal("Y/QXruiaxcJcmOnKWl4UEFuUqKTtbi4jTTeuEjeGV8s="))
})
}
})
Expand Down

0 comments on commit 6ff8bca

Please sign in to comment.