-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't trim Git branches/tags with slashes down to the first component
- Loading branch information
1 parent
1770b0d
commit c4db8d0
Showing
3 changed files
with
19 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package httplistener | ||
|
||
import "testing" | ||
|
||
func TestTemplates(t *testing.T) { | ||
test_refName(t, "refs/heads/main", "main") | ||
test_refName(t, "refs/tags/v1.2.3", "v1.2.3") | ||
test_refName(t, "refs/heads/feature/123-abc", "feature/123-abc") | ||
} | ||
|
||
func test_refName(t *testing.T, ref string, expected string) { | ||
got := refName(ref) | ||
if got != expected { | ||
t.Fatalf("Expected ref %q to be prettified to %q, got %q", ref, expected, got) | ||
} | ||
} |