From dd42100aa2f062a4e53399a3cabce732eaf0f6e5 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Fri, 30 Aug 2019 02:53:06 +0300 Subject: Barcode and ISIN --- isin/isin_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 isin/isin_test.go (limited to 'isin/isin_test.go') diff --git a/isin/isin_test.go b/isin/isin_test.go new file mode 100644 index 0000000..b7d084d --- /dev/null +++ b/isin/isin_test.go @@ -0,0 +1,22 @@ +package isin + +import ( + "testing" + + "github.com/neonxp/checksum" +) + +func TestISIN(t *testing.T) { + samples := map[string]error{ + "4600051000058": checksum.ErrInvalidChecksum, + "?600051000057": checksum.ErrInvalidNumber, + "A600051000057": checksum.ErrInvalidChecksum, + "4000000000006": nil, + "US0378331005": nil, + } + for num, result := range samples { + if err := Check(num); err != result { + t.Errorf("Expected %+v actual %+v for %s", result, err, num) + } + } +} -- cgit v1.2.3