aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/internal/lockfile/yarn_lockfile_test.go
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:55 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:55 +0800
commitfc8c5fdce62fb229202659408798a7b6c98f6e8b (patch)
tree7554f80e50de4af6fd255afa7c21bcdd58a7af34 /cli/internal/lockfile/yarn_lockfile_test.go
parentdd84b9d64fb98746a230cd24233ff50a562c39c9 (diff)
downloadHydroRoll-fc8c5fdce62fb229202659408798a7b6c98f6e8b.tar.gz
HydroRoll-fc8c5fdce62fb229202659408798a7b6c98f6e8b.zip
Diffstat (limited to 'cli/internal/lockfile/yarn_lockfile_test.go')
-rw-r--r--cli/internal/lockfile/yarn_lockfile_test.go51
1 files changed, 0 insertions, 51 deletions
diff --git a/cli/internal/lockfile/yarn_lockfile_test.go b/cli/internal/lockfile/yarn_lockfile_test.go
deleted file mode 100644
index ef4fcb0..0000000
--- a/cli/internal/lockfile/yarn_lockfile_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package lockfile
-
-import (
- "bytes"
- "testing"
-
- "gotest.tools/v3/assert"
-)
-
-func TestRoundtrip(t *testing.T) {
- content, err := getFixture(t, "yarn.lock")
- if err != nil {
- t.Error(err)
- }
-
- lockfile, err := DecodeYarnLockfile(content)
- if err != nil {
- t.Error(err)
- }
-
- var b bytes.Buffer
- if err := lockfile.Encode(&b); err != nil {
- t.Error(err)
- }
-
- assert.DeepEqual(t, string(content), b.String())
-}
-
-func TestKeySplitting(t *testing.T) {
- content, err := getFixture(t, "yarn.lock")
- if err != nil {
- t.Error(err)
- }
-
- lockfile, err := DecodeYarnLockfile(content)
- if err != nil {
- t.Error(err)
- }
-
- // @babel/types has multiple entries, these should all appear in the lockfile struct
- keys := []string{
- "@babel/types@^7.18.10",
- "@babel/types@^7.18.6",
- "@babel/types@^7.19.0",
- }
-
- for _, key := range keys {
- _, ok := lockfile.inner[key]
- assert.Assert(t, ok, "Unable to find entry for %s in parsed lockfile", key)
- }
-}