-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace "%s" with %q; octal literals for file permissions
- Loading branch information
1 parent
365f9b6
commit 28ab41a
Showing
7 changed files
with
59 additions
and
18 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
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
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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package reviser | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestStringToImportsOrder(t *testing.T) { | ||
t.Parallel() | ||
|
||
type args struct { | ||
importsOrder string | ||
} | ||
|
||
tests := []struct { | ||
name string | ||
args args | ||
wantErr string | ||
}{ | ||
{ | ||
name: "invalid groups count", | ||
args: args{importsOrder: "std,general"}, | ||
wantErr: `use this parameters to sort all groups of your imports: "std,general,company,project"`, | ||
}, | ||
{ | ||
name: "unknown group", | ||
args: args{importsOrder: "std,general,company,group"}, | ||
wantErr: `unknown order group type: "group"`, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
tt := tt | ||
t.Run(tt.name, func(t *testing.T) { | ||
t.Parallel() | ||
|
||
got, err := StringToImportsOrders(tt.args.importsOrder) | ||
|
||
assert.Nil(t, got) | ||
assert.EqualError(t, err, tt.wantErr) | ||
}) | ||
} | ||
} |