8000 Add `_.words` unit test for contractions. · lodash/lodash@7e885a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e885a4

Browse files
committed
Add _.words unit test for contractions.
1 parent a3c1f42 commit 7e885a4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24418,6 +24418,24 @@
2441824418
assert.deepEqual(_.words('æiou2Consonants'), ['æiou', '2', 'Consonants']);
2441924419
});
2442024420

24421+
QUnit.test('should work with contractions', function(assert) {
24422+
assert.expect(2);
24423+
24424+
var postfixes = ['d', 'll', 'm', 're', 's', 't', 've'];
24425+
24426+
lodashStable.each(["'", '\u2019'], function(apos) {
24427+
var actual = lodashStable.map(postfixes, function(postfix) {
24428+
return _.words('a b' + apos + postfix + ' c');
24429+
});
24430+
24431+
var expected = lodashStable.map(postfixes, function(postfix) {
24432+
return ['a', 'b' + apos + postfix, 'c'];
24433+
});
24434+
24435+
assert.deepEqual(actual, expected);
24436+
});
24437+
});
24438+
2442124439
QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
2442224440
assert.expect(1);
2442324441

0 commit comments

Comments
 (0)
0