diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-02-02 00:48:33 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-02-02 00:48:33 -0500 |
commit | c80a4241a4651293cdd25fbd4cc1bf1ddb6c5202 (patch) | |
tree | a49afb6d5927fb7422eb16c9eacdbfef579020cd /internal/feed | |
parent | 3498329782a4f2e38aad805f99abc67b882c2656 (diff) | |
download | cvez-c80a4241a4651293cdd25fbd4cc1bf1ddb6c5202.tar.bz2 cvez-c80a4241a4651293cdd25fbd4cc1bf1ddb6c5202.zip |
internal/feed/meta_test.go: test lastModifiedDate and scanner.Err()
Diffstat (limited to 'internal/feed')
-rw-r--r-- | internal/feed/meta_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/feed/meta_test.go b/internal/feed/meta_test.go index 640926c..7c61dd1 100644 --- a/internal/feed/meta_test.go +++ b/internal/feed/meta_test.go @@ -88,11 +88,17 @@ sha256:B86258D5D9861507A1894A7B92011764803D7267787B1487539E240EA2405440 }) } + longVal := make([]byte, 65536) + for i := 0; i < cap(longVal); i++ { + longVal[i] = 'a' + } + failTests := []struct { val string exp string } { { "asdf", "bad meta line: \"asdf\"" }, + { "lastModifiedDate:asdf", "parsing time \"asdf\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"asdf\" as \"2006\"" }, { "size:a", "invalid size: \"a\"" }, { "zipSize:a", "invalid zipSize: \"a\"" }, { "gzSize:a", "invalid gzSize: \"a\"" }, @@ -101,6 +107,7 @@ sha256:B86258D5D9861507A1894A7B92011764803D7267787B1487539E240EA2405440 val: "sha256:0z00000000000000000000000000000000000000000000000000000000000000", exp: "invalid sha256 hash: encoding/hex: invalid byte: U+007A 'z'", }, + { string(longVal), "bufio.Scanner: token too long" }, { "foo:bar", "unknown key: \"foo\"" }, } |