diff options
Diffstat (limited to 'classifier_test.go')
-rw-r--r-- | classifier_test.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/classifier_test.go b/classifier_test.go index b997a35..7ba32e6 100644 --- a/classifier_test.go +++ b/classifier_test.go @@ -797,41 +797,3 @@ func BenchmarkClassifier(b *testing.B) { classifier.NearestMatch(contents) } } - -func TestNew(t *testing.T) { - tests := []struct { - desc string - options []OptionFunc - wantArchive string - wantErr bool - }{ - { - desc: "no options, use default", - options: []OptionFunc{}, - wantArchive: LicenseArchive, - }, - { - desc: "specify ForbiddenLicenseArchive", - options: []OptionFunc{Archive(ForbiddenLicenseArchive)}, - wantArchive: ForbiddenLicenseArchive, - }, - { - desc: "file doesn't exist results in error", - options: []OptionFunc{Archive("doesnotexist")}, - wantArchive: "doesnotexist", - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - c, err := New(0.5, tt.options...) - if tt.wantErr != (err != nil) { - t.Fatalf("unexpected error: %v", err) - } - if err == nil && c.archive != tt.wantArchive { - t.Errorf("got archive %v, want %v", c.archive, tt.wantArchive) - } - }) - } - -} |