diff --git a/canonicalize_test.go b/canonicalize_test.go deleted file mode 100644 index 134ba5d..0000000 --- a/canonicalize_test.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2019 Opsmate, Inc. -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License, v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -// -// This software is distributed WITHOUT A WARRANTY OF ANY KIND. -// See the Mozilla Public License for details. - -package certspotter - -import ( - "testing" -) - -type stringCanonTest struct { - in string - out string -} - -var stringCanonTests = []stringCanonTest{ - {"", ""}, - {" ", ""}, - {" ", ""}, - {"abc", "abc"}, - {"aBc", "abc"}, - {"ab c", "ab c"}, - {"ab c", "ab c"}, - {"ab\n c", "ab c"}, - {" ab c ", "ab c"}, - {" ab c ", "ab c"}, - {" ab c", "ab c"}, - {"ab c ", "ab c"}, - {"abc ", "abc"}, - {"abc ", "abc"}, - {" abc ", "abc"}, - {" abc ", "abc"}, - {" abc", "abc"}, - {" aBc de f g\n", "abc de f g"}, -} - -func TestCanonicalizeRDNString(t *testing.T) { - for i, test := range stringCanonTests { - ret := canonicalizeRDNString(test.in) - if test.out != ret { - t.Errorf("#%d: canonicalizeRDNString(%q) = %q, want %q", i, test.in, ret, test.out) - } - } -}