From 526cef33c88069df96d3f184bbfcdd60db6167e9 Mon Sep 17 00:00:00 2001 From: Ada Date: Sun, 25 Feb 2024 00:35:11 +0100 Subject: [PATCH] :test_tube: Add test to ParseExpiration when a value is to high --- test/utils/utils_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/utils/utils_test.go b/test/utils/utils_test.go index f2a87b6..3525443 100644 --- a/test/utils/utils_test.go +++ b/test/utils/utils_test.go @@ -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 got := utils.ValidKey("ab_a-C42") want := true