-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deprecation notice for old config style
- Loading branch information
1 parent
7a91185
commit c064f2b
Showing
4 changed files
with
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package logging | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func Test_getMinorSemver(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
arg string | ||
want string | ||
}{ | ||
{ | ||
name: "default semver", | ||
arg: "v0.0.0-dev", | ||
want: "v0.0", | ||
}, | ||
{ | ||
name: "example semver", | ||
arg: "v2.0.1", | ||
want: "v2.0", | ||
}, | ||
{ | ||
name: "example semver with alpha notation", | ||
arg: "v3.0.0-alpha.0", | ||
want: "v3.0", | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := getMinorSemver(tt.arg); got != tt.want { | ||
t.Errorf("getMinorSemver() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func TestDocsURL(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
arg string | ||
want string | ||
}{ | ||
{ | ||
name: "url with no leading slash", | ||
arg: "features", | ||
want: "https://vektra.github.io/mockery/v0.0/features", | ||
}, | ||
{ | ||
name: "url with leading slash", | ||
arg: "/features", | ||
want: "https://vektra.github.io/mockery/v0.0/features", | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := DocsURL(tt.arg); got != tt.want { | ||
t.Errorf("DocsURL() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |