🧪 Add test to ParseExpiration when a value is to high #33
1 changed files with 8 additions and 0 deletions
|
@ -80,6 +80,14 @@ func TestParseExpirationInvalidRedundant(t *testing.T) { // test ParseExpiration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestParseExpirationInvalidTooHigh(t *testing.T) { // test ParseExpirationFull with all valid separator
|
||||||
|
_, got := utils.ParseExpiration("2d1h3m130s")
|
||||||
|
want := &utils.ParseExpirationError{}
|
||||||
|
if !errors.As(got, &want) {
|
||||||
|
t.Fatal("Error in ParseExpirationFull, want : ", want, "got : ", got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestValidKey(t *testing.T) { // test ValidKey with a valid key
|
func TestValidKey(t *testing.T) { // test ValidKey with a valid key
|
||||||
got := utils.ValidKey("ab_a-C42")
|
got := utils.ValidKey("ab_a-C42")
|
||||||
want := true
|
want := true
|
||||||
|
|
Loading…
Reference in a new issue