|
2591 | 2591 | }
|
2592 | 2592 | });
|
2593 | 2593 |
|
2594 |
| - QUnit.test('`_.' + methodName + '` should clone `index` and `input` array properties', function(assert) { |
2595 |
| - assert.expect(2); |
2596 |
| - |
2597 |
| - var array = /x/.exec('vwxyz'), |
2598 |
| - actual = func(array); |
2599 |
| - |
2600 |
| - assert.strictEqual(actual.index, 2); |
2601 |
| - assert.strictEqual(actual.input, 'vwxyz'); |
2602 |
| - }); |
2603 |
| - |
2604 |
| - QUnit.test('`_.' + methodName + '` should clone `lastIndex` regexp property', function(assert) { |
2605 |
| - assert.expect(1); |
2606 |
| - |
2607 |
| - // Avoid a regexp literal for older Opera and use `exec` for older Safari. |
2608 |
| - var regexp = RegExp('x', 'g'); |
2609 |
| - regexp.exec('vwxyz'); |
2610 |
| - |
2611 |
| - var actual = func(regexp); |
2612 |
| - assert.strictEqual(actual.lastIndex, 3); |
2613 |
| - }); |
2614 |
| - |
2615 | 2594 | QUnit.test('`_.' + methodName + '` should clone buffers', function(assert) {
|
2616 | 2595 | assert.expect(4);
|
2617 | 2596 |
|
|
2631 | 2610 | }
|
2632 | 2611 | });
|
2633 | 2612 |
|
| 2613 | + QUnit.test('`_.' + methodName + '` should clone `index` and `input` array properties', function(assert) { |
| 2614 | + assert.expect(2); |
| 2615 | + |
| 2616 | + var array = /c/.exec('abcde'), |
| 2617 | + actual = func(array); |
| 2618 | + |
| 2619 | + assert.strictEqual(actual.index, 2); |
| 2620 | + assert.strictEqual(actual.input, 'abcde'); |
| 2621 | + }); |
| 2622 | + |
| 2623 | + QUnit.test('`_.' + methodName + '` should clone `lastIndex` regexp property', function(assert) { |
| 2624 | + assert.expect(1); |
| 2625 | + |
| 2626 | + // Avoid a regexp literal for older Opera and use `exec` for older Safari. |
| 2627 | + var regexp = RegExp('c', 'g'); |
| 2628 | + |
| 2629 | + regexp.exec('abcde'); |
| 2630 | + |
| 2631 | + var actual = func(regexp); |
| 2632 | + assert.strictEqual(actual.lastIndex, 3); |
| 2633 | + }); |
| 2634 | + |
2634 | 2635 | QUnit.test('`_.' + methodName + '` should clone prototype objects', function(assert) {
|
2635 | 2636 | assert.expect(2);
|
2636 | 2637 |
|
|
8543 | 8544 |
|
8544 | 8545 | assert.strictEqual(_.isEqual(array1, array2), true);
|
8545 | 8546 |
|
8546 |
| - array1 = /x/.exec('vwxyz'); |
8547 |
| - array2 = ['x']; |
| 8547 | + array1 = /c/.exec('abcde'); |
| 8548 | + array2 = ['c']; |
8548 | 8549 |
|
8549 | 8550 | assert.strictEqual(_.isEqual(array1, array2), true);
|
8550 | 8551 | });
|
|
14121 | 14122 | QUnit.test('should not convert strings to arrays when merging arrays of `source`', function(assert) {
|
14122 | 14123 | assert.expect(1);
|
14123 | 14124 |
|
14124 |
| - var object = { 'a': 'abcdef' }, |
| 14125 | + var object = { 'a': 'abcde' }, |
14125 | 14126 | actual = _.merge(object, { 'a': ['x', 'y', 'z'] });
|
14126 | 14127 |
|
14127 | 14128 | assert.deepEqual(actual, { 'a': ['x', 'y', 'z'] });
|
|
17542 | 17543 | QUnit.test('should replace the matched pattern', function(assert) {
|
17543 | 17544 | assert.expect(2);
|
17544 | 17545 |
|
17545 |
| - var string = 'abcdef'; |
17546 |
| - assert.strictEqual(_.replace(string, 'def', '123'), 'abc123'); |
17547 |
| - assert.strictEqual(_.replace(string, /[bdf]/g, '-'), 'a-c-e-'); |
| 17546 | + var string = 'abcde'; |
| 17547 | + assert.strictEqual(_.replace(string, 'de', '123'), 'abc123'); |
| 17548 | + assert.strictEqual(_.replace(string, /[bd]/g, '-'), 'a-c-e'); |
17548 | 17549 | });
|
17549 | 17550 | }());
|
17550 | 17551 |
|
|
0 commit comments