-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from MrJohz/master
Allow multiple expected values to be passed into desc and makeFailure calls
- Loading branch information
Showing
5 changed files
with
92 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
"use strict"; | ||
|
||
test("Parsimmon.makeFailure", function() { | ||
var furthest = 4444; | ||
var expected = "waiting in the clock tower"; | ||
var result = Parsimmon.makeFailure(furthest, expected); | ||
assert.deepEqual(result, { | ||
status: false, | ||
index: -1, | ||
value: null, | ||
furthest: furthest, | ||
expected: [expected] | ||
suite("Parsimmon.makeFailure", function() { | ||
test("creates a failure result", function() { | ||
var furthest = 4444; | ||
var expected = "waiting in the clock tower"; | ||
var result = Parsimmon.makeFailure(furthest, expected); | ||
assert.deepEqual(result, { | ||
status: false, | ||
index: -1, | ||
value: null, | ||
furthest: furthest, | ||
expected: [expected] | ||
}); | ||
}); | ||
test("creates a result with multiple expected values", function() { | ||
var furthest = 4444; | ||
var expected = ["once", "twice", "three times a lady"]; | ||
var result = Parsimmon.makeFailure(furthest, expected); | ||
assert.deepEqual(result, { | ||
status: false, | ||
index: -1, | ||
value: null, | ||
furthest: furthest, | ||
expected: expected | ||
}); | ||
}); | ||
}); |