mirror of
https://github.com/thegeeklab/drone-template-lib.git
synced 2024-11-16 09:50:39 +00:00
Add test for negative truncation
This commit is contained in:
parent
be0e4a22ab
commit
ecbb4a10a5
@ -53,6 +53,22 @@ func TestTruncate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestNegativeTruncate(t *testing.T) {
|
||||||
|
vals := map[string]string{
|
||||||
|
"foobarz": "rz",
|
||||||
|
"foöäüüu": "üu",
|
||||||
|
"üpsßßßk": "ßk",
|
||||||
|
"1234567": "67",
|
||||||
|
"!'§$%&/": "&/",
|
||||||
|
}
|
||||||
|
|
||||||
|
for input, want := range vals {
|
||||||
|
if got := truncate(input, -5); got != want {
|
||||||
|
t.Errorf("Want transform %s to %s, got %s", input, want, got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestSince(t *testing.T) {
|
func TestSince(t *testing.T) {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user