Skip to content

Commit 80cd52f

Browse files
committed
test: remove nonsense case and correct names (#176)
`Gemfile.lock` is nothing close to JSON, so this test doesn't make sense - removing it does not decrease coverage either, so lets axe it. My best guess is that it came from copying the standard set of tests from one of the other parsers, and then not realising it since it never failed 🤷 I also noticed two test cases were incorrectly named "json" instead of "toml", so have corrected that too
1 parent a03cbc9 commit 80cd52f

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

pkg/lockfile/parse-cargo-lock_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestParseCargoLock_FileDoesNotExist(t *testing.T) {
1414
expectPackages(t, packages, []lockfile.PackageDetails{})
1515
}
1616

17-
func TestParseCargoLock_InvalidJson(t *testing.T) {
17+
func TestParseCargoLock_InvalidToml(t *testing.T) {
1818
t.Parallel()
1919

2020
packages, err := lockfile.ParseCargoLock("fixtures/cargo/not-toml.txt")

pkg/lockfile/parse-gemfile-lock_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@ func TestParseGemfileLock_FileDoesNotExist(t *testing.T) {
1414
expectPackages(t, packages, []lockfile.PackageDetails{})
1515
}
1616

17-
func TestParseGemfileLock_InvalidJson(t *testing.T) {
18-
t.Parallel()
19-
20-
packages, err := lockfile.ParseGemfileLock("fixtures/bundler/not-json.txt")
21-
22-
if err == nil {
23-
t.Errorf("Expected to get error, but did not")
24-
}
25-
26-
expectPackages(t, packages, []lockfile.PackageDetails{})
27-
}
28-
2917
func TestParseGemfileLock_NoSpecSection(t *testing.T) {
3018
t.Parallel()
3119

pkg/lockfile/parse-poetry-lock_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestParsePoetryLock_FileDoesNotExist(t *testing.T) {
1414
expectPackages(t, packages, []lockfile.PackageDetails{})
1515
}
1616

17-
func TestParsePoetryLock_InvalidJson(t *testing.T) {
17+
func TestParsePoetryLock_InvalidToml(t *testing.T) {
1818
t.Parallel()
1919

2020
packages, err := lockfile.ParsePoetryLock("fixtures/poetry/not-toml.txt")

0 commit comments

Comments
 (0)