new tests to fix #2 by not breaking when initial tests fail in our recheck function

This commit is contained in:
deltreey
2017-04-24 02:04:22 -04:00
parent c43fd58f33
commit ec0e1be095
3 changed files with 24 additions and 1 deletions

View File

@@ -267,6 +267,18 @@ describe('wildstring - angular', function() {
// Then: we should see that they match
assert.equal(result, true);
});
it('should be able to see the same character as a wildcard', function() {
// Given: a string with the same character multiple times, and a pattern with a wildcard and some of the same character
var pattern = '*zz',
string = 'zzz';
// When: we call wildstring.match
var result = wildstring.match(pattern, string);
// Then: we should see that they match
assert.equal(result, true);
});
});
describe('#replace', function() {

View File

@@ -261,6 +261,18 @@ describe('wildstring - node', function() {
// Then: we should see that they match
assert.equal(result, true);
});
it('should be able to see the same character as a wildcard', function() {
// Given: a string with the same character multiple times, and a pattern with a wildcard and some of the same character
var pattern = '*zz',
string = 'zzz';
// When: we call wildstring.match
var result = wildstring.match(pattern, string);
// Then: we should see that they match
assert.equal(result, true);
});
});
describe('#replace', function() {

View File

@@ -30,7 +30,6 @@ var wildstring = {
rollbackStrings.push({ string: testString, index: patternIndex });
if (testString.indexOf(patternSubstrings[patternIndex]) === -1) {
rollbackStrings.pop();
break;
}
currentString = currentString.substr(