diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2016-02-28 11:23:54 -0500 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2016-02-28 11:23:54 -0500 |
| commit | c4060f7d80fc3d24b9f5f31552a969d41b6b7b00 (patch) | |
| tree | 974f9c5430ba9522f731c27750bd945d492aa117 /names_test.go | |
| parent | 34abed2be3e96b16327a6031d4931f9b98593abe (diff) | |
| download | bibtex-c4060f7d80fc3d24b9f5f31552a969d41b6b7b00.tar.gz | |
Make isLower a function for strings not tokens
Diffstat (limited to 'names_test.go')
| -rw-r--r-- | names_test.go | 29 |
1 files changed, 28 insertions, 1 deletions
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) } } } |
