-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MINOR: fragments: add support for git fragments
- Loading branch information
Showing
3 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ allowed: | |
- runnumber | ||
- LLC | ||
- devel | ||
- ioutil | ||
- defaultconf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package aspell | ||
|
||
import "testing" | ||
import ( | ||
"testing" | ||
) | ||
|
||
func Test_checkWithAspell(t *testing.T) { | ||
aspell := Aspell{ | ||
|
@@ -31,3 +33,68 @@ func Test_checkWithAspell(t *testing.T) { | |
}) | ||
} | ||
} | ||
|
||
func TestAspell_Check(t *testing.T) { | ||
type fields struct { | ||
Mode mode | ||
MinLength int | ||
IgnoreFiles []string | ||
AllowedWords []string | ||
HelpText string | ||
} | ||
type args struct { | ||
subjects []string | ||
commitsFull []string | ||
content []map[string]string | ||
} | ||
tests := []struct { | ||
name string | ||
fields fields | ||
args args | ||
wantErr bool | ||
}{{ | ||
"Signed off", | ||
fields{ | ||
Mode: modeCommit, | ||
MinLength: 3, | ||
IgnoreFiles: []string{"config"}, | ||
AllowedWords: []string{"config"}, | ||
HelpText: "test", | ||
}, | ||
args{ | ||
subjects: []string{"BUG/MEDIUM: config: add default location of path to the configuration file"}, | ||
commitsFull: []string{" Signed-off-by: Author: A locatoin <[email protected]>"}, | ||
content: []map[string]string{{"test": "test"}}, | ||
}, | ||
false, | ||
}, { | ||
"Signed off", | ||
fields{ | ||
Mode: modeCommit, | ||
MinLength: 3, | ||
IgnoreFiles: []string{"config"}, | ||
AllowedWords: []string{"config"}, | ||
HelpText: "test", | ||
}, | ||
args{ | ||
subjects: []string{"BUG/MEDIUM: config: add default location of path to the configuration file"}, | ||
commitsFull: []string{"mitsake", " Signed-off-by: Author: A locatoin <[email protected]>"}, | ||
content: []map[string]string{{"test": "test"}}, | ||
}, | ||
true, | ||
}} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
a := Aspell{ | ||
Mode: tt.fields.Mode, | ||
MinLength: tt.fields.MinLength, | ||
IgnoreFiles: tt.fields.IgnoreFiles, | ||
AllowedWords: tt.fields.AllowedWords, | ||
HelpText: tt.fields.HelpText, | ||
} | ||
if err := a.Check(tt.args.subjects, tt.args.commitsFull, tt.args.content); (err != nil) != tt.wantErr { | ||
t.Errorf("Aspell.Check() error = %v, wantErr %v", err, tt.wantErr) | ||
} | ||
}) | ||
} | ||
} |