Skip to content

Commit 032641c

Browse files
Test case-sensitivity of string comparisons
1 parent 39f1c7a commit 032641c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/utils/string.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,19 @@ describe('groupByCommonHead', () => {
7878
foo: { ' bar': {}, bar: {} },
7979
});
8080
});
81+
82+
it('is case-sensitive with string heads', () => {
83+
const words = ['Foo', 'foo'];
84+
expect(groupByCommonHead(words)).toEqual({
85+
Foo: {},
86+
foo: {},
87+
});
88+
});
89+
90+
it('is case-sensitive with string tails', () => {
91+
const words = ['foo', 'foO'];
92+
expect(groupByCommonHead(words)).toEqual({
93+
fo: { o: {}, O: {} },
94+
});
95+
});
8196
});

0 commit comments

Comments
 (0)