From c4060f7d80fc3d24b9f5f31552a969d41b6b7b00 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Sun, 28 Feb 2016 11:23:54 -0500 Subject: Make isLower a function for strings not tokens --- names_test.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'names_test.go') diff --git a/names_test.go b/names_test.go index 0cc97a0..ad8ba05 100644 --- a/names_test.go +++ b/names_test.go @@ -93,7 +93,34 @@ func TestLength(t *testing.T) { for _, test := range tests { actual := length(test.s) if test.expected != actual { - t.Errorf("Expected: %d, actual: %d", test.expected, actual) + t.Errorf("%s, expected: %d, actual: %d", test.s, + test.expected, actual) + } + } +} + +func TestIsLower(t *testing.T) { + tests := []struct { + s string + expected bool + }{ + {"", false}, + {"abc", true}, + {"Abc", false}, + {"a{bc}", true}, + {"A{bc}", false}, + {"{a}A", false}, + {"{A}a", true}, + {"{\\i B}A", true}, + {"{\\AA a}a", false}, + {"{abc}A", false}, + {"{Abc}a", true}, + } + for _, test := range tests { + actual := isLower(test.s) + if test.expected != actual { + t.Errorf("%s, expected: %t, actual: %t", test.s, + test.expected, actual) } } } -- cgit v1.2.3-70-g09d2