Make unit tests error messages consistent

Different formulations are used for unit tests error messages. Use the
form "should..." for all error messages.
This commit is contained in:
David Dufresne
2016-07-23 14:00:52 -04:00
parent 3c9de864de
commit f5e12e2c2e
7 changed files with 148 additions and 148 deletions

View File

@@ -17,7 +17,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["axyz", "exyz", "ixyz", "oxyz", "uxyz"]
let errorMessage = "GenericParser.oneOf did not succeed."
let errorMessage = "GenericParser.oneOf should succeed."
testStringParserSuccess(vowel, inputs: matching) { input, result in
@@ -35,7 +35,7 @@ class CharacterTests: XCTestCase {
// Test for failure.
let notMatching = ["xyzu", "yzo", "zi", "taeiou", "vexyz"]
let shouldFailMessage = "GenericParser.oneOf should have failed."
let shouldFailMessage = "GenericParser.oneOf should fail."
testStringParserFailure(vowel, inputs: notMatching) { input, result in
@@ -57,7 +57,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["axyz", "éxyz", "ixyz", "oxyz", "uxyz"]
let errorMessage = "GenericParser.oneOf did not succeed."
let errorMessage = "GenericParser.oneOf should succeed."
testStringParserSuccess(interval, inputs: matching) { input, result in
@@ -75,7 +75,7 @@ class CharacterTests: XCTestCase {
// Test for failure.
let notMatching = ["1xyzu", "?yzo", "Ezi", ")taeiou", "@vexyz"]
let shouldFailMessage = "GenericParser.oneOf should have failed."
let shouldFailMessage = "GenericParser.oneOf should fail."
testStringParserFailure(interval, inputs: notMatching)
{ input, result in
@@ -97,7 +97,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["xayz", "reyz", "fiyz", "doyz", "cuyz"]
let errorMessage = "GenericParser.noneOf did not succeed."
let errorMessage = "GenericParser.noneOf should succeed."
testStringParserSuccess(consonant, inputs: matching) { input, result in
@@ -115,7 +115,7 @@ class CharacterTests: XCTestCase {
// Test for failure.
let notMatching = ["axyz", "exyz", "ixyz", "oxyz", "uxyz"]
let shouldFailMessage = "GenericParser.noneOf should have failed."
let shouldFailMessage = "GenericParser.noneOf should fail."
testStringParserFailure(consonant, inputs: notMatching)
{ input, result in
@@ -140,7 +140,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = [" \n \t \r \r\n" + suffix]
let errorMessage = "GenericParser.spaces did not succeed."
let errorMessage = "GenericParser.spaces should succeed."
testStringParserSuccess(skipSpaces, inputs: matching) { input, result in
@@ -158,7 +158,7 @@ class CharacterTests: XCTestCase {
// Test when not matching.
let notMatching = ["axyz", "exyz", "ixyz", "oxyz", "uxyz"]
let shouldFailMessage = "GenericParser.spaces should have failed."
let shouldFailMessage = "GenericParser.spaces should fail."
testStringParserFailure(skipSpaces, inputs: notMatching)
{ input, result in
@@ -188,7 +188,7 @@ class CharacterTests: XCTestCase {
"\u{200A}", "\u{200B}fhd", "\u{2028}", "\u{2029}", "\u{202F}ghfd",
"\u{205F}gh", "\u{3000}hjg", "\u{FEFF}kgh"
]
let errorMessage = "GenericParser.unicodeSpace did not succeed."
let errorMessage = "GenericParser.unicodeSpace should succeed."
testStringParserSuccess(space, inputs: matching) { input, result in
@@ -206,7 +206,7 @@ class CharacterTests: XCTestCase {
// Test when not matching.
let notMatching = ["axyz "]
let shouldFailMessage = "GenericParser.unicodeSpace should have failed."
let shouldFailMessage = "GenericParser.unicodeSpace should fail."
testStringParserFailure(space, inputs: notMatching) { input, result in
@@ -231,7 +231,7 @@ class CharacterTests: XCTestCase {
" xadf", "\tljk", "\n;k", "\r;kl", "\r\nadf", "\u{000C}jkl",
"\u{000B}gjh"
]
let errorMessage = "GenericParser.space did not succeed."
let errorMessage = "GenericParser.space should succeed."
testStringParserSuccess(space, inputs: matching) { input, result in
@@ -249,7 +249,7 @@ class CharacterTests: XCTestCase {
// Test when not matching.
let notMatching = ["axyz "]
let shouldFailMessage = "GenericParser.space should have failed."
let shouldFailMessage = "GenericParser.space should fail."
testStringParserFailure(space, inputs: notMatching) { input, result in
@@ -271,7 +271,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["\n"]
let errorMessage = "GenericParser.newLine did not succeed."
let errorMessage = "GenericParser.newLine should succeed."
testStringParserSuccess(newLine, inputs: matching) { input, result in
@@ -289,7 +289,7 @@ class CharacterTests: XCTestCase {
// Test when not matching.
let notMatching = ["axyz\n"]
let shouldFailMessage = "GenericParser.newLine should have failed."
let shouldFailMessage = "GenericParser.newLine should fail."
testStringParserFailure(newLine, inputs: notMatching) { input, result in
@@ -312,7 +312,7 @@ class CharacterTests: XCTestCase {
// Test for success.
// "\r\n" is combined in one Unicode Scalar.
let matching = ["\r\n", "\u{000D}\u{000A}"]
let errorMessage = "GenericParser.crlf did not succeed."
let errorMessage = "GenericParser.crlf should succeed."
testStringParserSuccess(newLine, inputs: matching) { input, result in
@@ -330,7 +330,7 @@ class CharacterTests: XCTestCase {
// Test when not matching.
let notMatching = ["\n", "\r", "\n\r", "adsf\r\n"]
let shouldFailMessage = "GenericParser.crlf should have failed."
let shouldFailMessage = "GenericParser.crlf should fail."
testStringParserFailure(newLine, inputs: notMatching) { input, result in
@@ -353,7 +353,7 @@ class CharacterTests: XCTestCase {
// Test for success.
// "\r\n" is combined in one Unicode Scalar.
let matching = ["\r\n", "\u{000D}\u{000A}", "\n"]
let errorMessage = "GenericParser.endOfLine did not succeed."
let errorMessage = "GenericParser.endOfLine should succeed."
testStringParserSuccess(endOfLine, inputs: matching) { input, result in
@@ -371,7 +371,7 @@ class CharacterTests: XCTestCase {
// Test when not matching.
let notMatching = ["\r", "ddsdf\n\r", "adsf\r\n", "adsf'\n"]
let shouldFailMessage = "GenericParser.endOfLine should have failed."
let shouldFailMessage = "GenericParser.endOfLine should fail."
testStringParserFailure(endOfLine, inputs: notMatching)
{ input, result in
@@ -394,7 +394,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["\t"]
let errorMessage = "GenericParser.tab did not succeed."
let errorMessage = "GenericParser.tab should succeed."
testStringParserSuccess(tab, inputs: matching) { input, result in
@@ -412,7 +412,7 @@ class CharacterTests: XCTestCase {
// Test when not matching.
let notMatching = ["axyz\t"]
let shouldFailMessage = "GenericParser.tab should have failed."
let shouldFailMessage = "GenericParser.tab should fail."
testStringParserFailure(tab, inputs: notMatching) { input, result in
@@ -434,7 +434,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["Ezcxv", "A", "À", "Ç", "É", "È", "Ë", "Ê", "Ùaff"]
let errorMessage = "GenericParser.uppercase did not succeed."
let errorMessage = "GenericParser.uppercase should succeed."
testStringParserSuccess(uppercase, inputs: matching) { input, result in
@@ -454,7 +454,7 @@ class CharacterTests: XCTestCase {
let notMatching = [
"easdf", "a", "à", "ç", "é", "è", "ê", "ùasdf", ";", ":", ","
]
let shouldFailMessage = "GenericParser.uppercase should have failed."
let shouldFailMessage = "GenericParser.uppercase should fail."
testStringParserFailure(uppercase, inputs: notMatching)
{ input, result in
@@ -477,7 +477,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["easdf", "a", "à", "ç", "é", "è", "ê", "ùasdf"]
let errorMessage = "GenericParser.lowercase did not succeed."
let errorMessage = "GenericParser.lowercase should succeed."
testStringParserSuccess(lowercase, inputs: matching) { input, result in
@@ -497,7 +497,7 @@ class CharacterTests: XCTestCase {
let notMatching = [
"Ezcxv", "A", "À", "Ç", "É", "È", "Ë", "Ê", "Ùaff", ";", ":", ","
]
let shouldFailMessage = "GenericParser.lowercase should have failed."
let shouldFailMessage = "GenericParser.lowercase should fail."
testStringParserFailure(lowercase, inputs: notMatching)
{ input, result in
@@ -524,7 +524,7 @@ class CharacterTests: XCTestCase {
"Ezcxv", "A", "À", "Ç", "É", "È", "Ë", "Ê", "Ùaff", "1", "2", "3",
"4", "5", "6", "7", "8", "9", "0"
]
let errorMessage = "GenericParser.alphaNumeric did not succeed."
let errorMessage = "GenericParser.alphaNumeric should succeed."
testStringParserSuccess(alphaNum, inputs: matching) { input, result in
@@ -546,7 +546,7 @@ class CharacterTests: XCTestCase {
"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "=", "}",
"{", "<", ">", "?", "\u{E9}\u{20DD}"
]
let shouldFailMessage = "GenericParser.alphaNumeric should have failed."
let shouldFailMessage = "GenericParser.alphaNumeric should fail."
testStringParserFailure(alphaNum, inputs: notMatching)
{ input, result in
@@ -572,7 +572,7 @@ class CharacterTests: XCTestCase {
"easdf", "a", "à", "ç", "é", "è", "ê", "ùasdf", "Ezcxv", "A", "À",
"Ç", "É", "È", "Ë", "Ê", "Ùaff"
]
let errorMessage = "GenericParser.letter did not succeed."
let errorMessage = "GenericParser.letter should succeed."
testStringParserSuccess(letter, inputs: matching) { input, result in
@@ -594,7 +594,7 @@ class CharacterTests: XCTestCase {
"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "=", "}",
"{", "<", ">", "?", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"
]
let shouldFailMessage = "GenericParser.letter should have failed."
let shouldFailMessage = "GenericParser.letter should fail."
testStringParserFailure(letter, inputs: notMatching) { input, result in
@@ -616,7 +616,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["+", "÷", "±", "$", ""]
let errorMessage = "GenericParser.symbol did not succeed."
let errorMessage = "GenericParser.symbol should succeed."
testStringParserSuccess(symbol, inputs: matching) { input, result in
@@ -638,7 +638,7 @@ class CharacterTests: XCTestCase {
"Ç", "É", "È", "Ë", "Ê", "Ùaff", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "0"
]
let shouldFailMessage = "GenericParser.letter should have failed."
let shouldFailMessage = "GenericParser.letter should fail."
testStringParserFailure(symbol, inputs: notMatching) { input, result in
@@ -660,7 +660,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
let errorMessage = "GenericParser.digit did not succeed."
let errorMessage = "GenericParser.digit should succeed."
testStringParserSuccess(digit, inputs: matching) { input, result in
@@ -683,7 +683,7 @@ class CharacterTests: XCTestCase {
"{", "<", ">", "?", "easdf", "a", "à", "ç", "é", "è", "ê", "ùasdf",
"Ezcxv", "A", "À", "Ç", "É", "È", "Ë", "Ê", "Ùaff"
]
let shouldFailMessage = "GenericParser.digit should have failed."
let shouldFailMessage = "GenericParser.digit should fail."
testStringParserFailure(digit, inputs: notMatching) { input, result in
@@ -705,7 +705,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
let errorMessage = "GenericParser.decimalDigit did not succeed."
let errorMessage = "GenericParser.decimalDigit should succeed."
testStringParserSuccess(hexDigit, inputs: matching) { input, result in
@@ -729,7 +729,7 @@ class CharacterTests: XCTestCase {
"È", "Ë", "Ê", "Ùaff", "a", "b", "c", "d", "e", "f", "A", "B", "C",
"D", "E", "F"
]
let shouldFailMessage = "GenericParser.decimalDigit should have failed."
let shouldFailMessage = "GenericParser.decimalDigit should fail."
testStringParserFailure(hexDigit, inputs: notMatching)
{ input, result in
@@ -755,7 +755,7 @@ class CharacterTests: XCTestCase {
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c",
"d", "e", "f", "A", "B", "C", "D", "E", "F"
]
let errorMessage = "GenericParser.hexadecimalDigit did not succeed."
let errorMessage = "GenericParser.hexadecimalDigit should succeed."
testStringParserSuccess(hexDigit, inputs: matching) { input, result in
@@ -780,7 +780,7 @@ class CharacterTests: XCTestCase {
]
let shouldFailMessage =
"GenericParser.hexadecimalDigit should have failed."
"GenericParser.hexadecimalDigit should fail."
testStringParserFailure(hexDigit, inputs: notMatching)
{ input, result in
@@ -803,7 +803,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = ["1", "2", "3", "4", "5", "6", "7", "0"]
let errorMessage = "GenericParser.octalDigit did not succeed."
let errorMessage = "GenericParser.octalDigit should succeed."
testStringParserSuccess(octDigit, inputs: matching) { input, result in
@@ -826,7 +826,7 @@ class CharacterTests: XCTestCase {
"{", "<", ">", "?", "à", "ç", "é", "è", "ê", "ùasdf", "À", "Ç", "É",
"È", "Ë", "Ê", "Ùaff", "8", "9"
]
let shouldFailMessage = "GenericParser.octalDigit should have failed."
let shouldFailMessage = "GenericParser.octalDigit should fail."
testStringParserFailure(octDigit, inputs: notMatching)
{ input, result in
@@ -850,7 +850,7 @@ class CharacterTests: XCTestCase {
// Test for success.
let matching = [stringToMatch + "qewr", stringToMatch]
let errorMessage = "GenericParser.string did not succeed."
let errorMessage = "GenericParser.string should succeed."
testStringParserSuccess(string1, inputs: matching) { input, result in
@@ -873,7 +873,7 @@ class CharacterTests: XCTestCase {
to: stringToMatch.index(before: stringToMatch.endIndex)
)
]
let shouldFailMessage = "GenericParser.string should have failed."
let shouldFailMessage = "GenericParser.string should fail."
testStringParserFailure(string1, inputs: notMatching) { input, result in

View File

@@ -23,7 +23,7 @@ class CombinatorTests: XCTestCase {
// Test for success.
let matching = ["1a ", "a1 ", " 1a"]
let errorMessage = "GenericParser.choice error."
let errorMessage = "GenericParser.choice should succeed."
testStringParserSuccess(choice, inputs: matching) { input, result in
@@ -41,7 +41,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["", ";1 a", "+a 1"]
let shouldFailMessage = "GenericParser.choice should have failed."
let shouldFailMessage = "GenericParser.choice should fail."
testStringParserFailure(choice, inputs: notMatching) { input, result in
@@ -65,7 +65,7 @@ class CombinatorTests: XCTestCase {
// Test for success.
let matchingDigit = ["1a ", "a1 ", " 1a"]
let errorMessage = "GenericParser.otherwise error."
let errorMessage = "GenericParser.otherwise should succeed."
testStringParserSuccess(digit, inputs: matchingDigit) { input, result in
@@ -104,7 +104,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["ab1", "a12"]
let shouldFailMessage = "GenericParser.otherwise should have failed."
let shouldFailMessage = "GenericParser.otherwise should fail."
testStringParserFailure(string, inputs: notMatching) { input, result in
@@ -127,7 +127,7 @@ class CombinatorTests: XCTestCase {
// Test for success.
let matchingDigit = ["1a ", "a1 ", " 1a"]
let errorMessage = "GenericParser.optional error."
let errorMessage = "GenericParser.optional should succeed."
testStringParserSuccess(optionalDigit, inputs: matchingDigit)
{ input, result in
@@ -165,7 +165,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["ab1", "a12"]
let shouldFailMessage = "GenericParser.optional should have failed."
let shouldFailMessage = "GenericParser.optional should fail."
testStringParserFailure(optionalString, inputs: notMatching)
{ input, result in
@@ -196,7 +196,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["ab1", "a12"]
let shouldFailMessage = "GenericParser.discard should have failed."
let shouldFailMessage = "GenericParser.discard should fail."
testStringParserFailure(discardString, inputs: notMatching)
{ input, result in
@@ -222,7 +222,7 @@ class CombinatorTests: XCTestCase {
// Test for success.
let matchingDigit = ["(1) ", "(2)adsf", "(3)xfsa"]
let errorMessage = "GenericParser.between error."
let errorMessage = "GenericParser.between should succeed."
testStringParserSuccess(digit, inputs: matchingDigit)
{ inputStr, result in
@@ -273,7 +273,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["{[(ab)]}", "{[(abc)]", "[(abc)]}"]
let shouldFailMessage = "GenericParser.between should have failed."
let shouldFailMessage = "GenericParser.between should fail."
testStringParserFailure(string, inputs: notMatching) { input, result in
@@ -300,7 +300,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["asd", "asdfasd", "xasdf"]
let shouldFailMessage = "GenericParser.skipMany1 should have failed."
let shouldFailMessage = "GenericParser.skipMany1 should fail."
testStringParserFailure(skipMany1, inputs: notMatching)
{ input, result in
@@ -323,7 +323,7 @@ class CombinatorTests: XCTestCase {
// Test for success.
let matching = ["asdfasdf", "asdfasdfasdf", "asdfasdfasdfasdf"]
let errorMessage = "GenericParser.many1 error."
let errorMessage = "GenericParser.many1 should succeed."
testStringParserSuccess(manyString, inputs: matching) { input, result in
@@ -341,7 +341,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["asd", "asdfasd", "xasdf"]
let shouldFailMessage = "GenericParser.many1 should have failed."
let shouldFailMessage = "GenericParser.many1 should fail."
testStringParserFailure(manyString, inputs: notMatching)
{ input, result in
@@ -371,7 +371,7 @@ class CombinatorTests: XCTestCase {
"adsf", "asd,fasdÀf,qeàwr,dÉgéh", "234,adsf,erty", ",adsf,zsdf"
]
let errorMessage = "GenericParser.separatedBy error."
let errorMessage = "GenericParser.separatedBy should succeed."
testStringParserSuccess(commaSeparated, inputs: matching)
{ input, result in
@@ -391,7 +391,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["asd,,", "adsf,wert,1"]
let shouldFailMessage = "GenericParser.separatedBy should have failed."
let shouldFailMessage = "GenericParser.separatedBy should fail."
testStringParserFailure(commaSeparated, inputs: notMatching)
{ input, result in
@@ -419,7 +419,7 @@ class CombinatorTests: XCTestCase {
// Test for success.
let matching = ["adsf", "asd,fasdÀf,qeàwr,dÉgéh", "adsf,zsdf"]
let errorMessage = "GenericParser.separatedBy1 error."
let errorMessage = "GenericParser.separatedBy1 should succeed."
testStringParserSuccess(commaSeparated, inputs: matching)
{ input, result in
@@ -441,7 +441,7 @@ class CombinatorTests: XCTestCase {
let notMatching = [
"asd,,", "adsf,wert,1", "234,adsf,erty", ",adsf,zsdf"
]
let shouldFailMessage = "GenericParser.separatedBy1 should have failed."
let shouldFailMessage = "GenericParser.separatedBy1 should fail."
testStringParserFailure(commaSeparated, inputs: notMatching)
{ input, result in
@@ -466,7 +466,7 @@ class CombinatorTests: XCTestCase {
let letters = StringParser.letter.many1.stringValue
let commaSeparated = letters.dividedBy(comma) <* StringParser.eof
let errorMessage = "GenericParser.dividedBy error."
let errorMessage = "GenericParser.dividedBy should succeed."
// End separator required.
let endRequired = ["adsf,", "asd,fasdÀf,qeàwr,dÉgéh,"]
@@ -522,7 +522,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["adsf,wert,werb", "234,adsf,erty,", ",adsf,zsdf,"]
let shouldFailMessage = "GenericParser.dividedBy should have failed."
let shouldFailMessage = "GenericParser.dividedBy should fail."
testStringParserFailure(commaSeparated, inputs: notMatching)
{ input, result in
@@ -547,7 +547,7 @@ class CombinatorTests: XCTestCase {
let letters = StringParser.letter.many1.stringValue
let commaSeparated = letters.dividedBy1(comma)
let errorMessage = "GenericParser.dividedBy1 error."
let errorMessage = "GenericParser.dividedBy1 should succeed."
// End separator required.
let endRequired = ["adsf,", "asd,fasdÀf,qeàwr,dÉgéh,"]
@@ -602,7 +602,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["adsf,wert,werb", ",adsf,zsdf,", "234,adsf,erty,"]
let shouldFailMessage = "GenericParser.dividedBy1 should have failed."
let shouldFailMessage = "GenericParser.dividedBy1 should fail."
testStringParserFailure(commaSeparated, inputs: notMatching)
{ input, result in
@@ -621,7 +621,7 @@ class CombinatorTests: XCTestCase {
func testCount() {
let errorMessage = "GenericParser.count error."
let errorMessage = "GenericParser.count should succeed."
let countNumber = 3
let letters = StringParser.letter.many.stringValue.count(countNumber)
@@ -668,7 +668,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatchingAsdf = ["asd1", "asdfasdfasd1", "1asdf", "asdf"]
let shouldFailMessage = "GenericParser.count should have failed."
let shouldFailMessage = "GenericParser.count should fail."
testStringParserFailure(asdf, inputs: notMatchingAsdf)
{ input, result in
@@ -709,7 +709,7 @@ class CombinatorTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericParser.chainRight error."
let errorMessage = "GenericParser.chainRight should succeed."
testStringParserSuccess(exp, inputs: matching) { input, result in
@@ -728,7 +728,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["2.0**", "2.0**2.0*"]
let shouldFailMessage = "GenericParser.chainRight should have failed."
let shouldFailMessage = "GenericParser.chainRight should fail."
testStringParserFailure(exp, inputs: notMatching) { input, result in
@@ -766,7 +766,7 @@ class CombinatorTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericParser.chainRight1 error."
let errorMessage = "GenericParser.chainRight1 should succeed."
testStringParserSuccess(exp, inputs: matching) { input, result in
@@ -785,7 +785,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["2.0**", "2.0**2.0*", "a"]
let shouldFailMessage = "GenericParser.chainRight1 should have failed."
let shouldFailMessage = "GenericParser.chainRight1 should fail."
testStringParserFailure(exp, inputs: notMatching) { input, result in
@@ -817,7 +817,7 @@ class CombinatorTests: XCTestCase {
var index = 0
let errorMessage = "GenericParser.chainLeft error."
let errorMessage = "GenericParser.chainLeft should succeed."
testStringParserSuccess(add, inputs: matchingAdd) { input, result in
@@ -862,7 +862,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["2*", "2*2*"]
let shouldFailMessage = "GenericParser.chainLeft should have failed."
let shouldFailMessage = "GenericParser.chainLeft should fail."
testStringParserFailure(mul, inputs: notMatching) { input, result in
@@ -894,7 +894,7 @@ class CombinatorTests: XCTestCase {
var index = 0
let errorMessage = "GenericParser.chainLeft1 error."
let errorMessage = "GenericParser.chainLeft1 should succeed."
testStringParserSuccess(add, inputs: matchingAdd) { input, result in
@@ -939,7 +939,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["2*", "2*2*", "a"]
let shouldFailMessage = "GenericParser.chainLeft1 should have failed."
let shouldFailMessage = "GenericParser.chainLeft1 should fail."
testStringParserFailure(mulOp, inputs: notMatching) { input, result in
@@ -963,7 +963,7 @@ class CombinatorTests: XCTestCase {
// Test for success.
let matching = ["let", "let;", "let "]
let errorMessage = "GenericParser.noOccurence error."
let errorMessage = "GenericParser.noOccurence should succeed."
testStringParserSuccess(keyworkLet, inputs: matching) { input, result in
@@ -981,7 +981,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["lets", "let2", "le", "a"]
let shouldFailMessage = "GenericParser.noOccurence should have failed."
let shouldFailMessage = "GenericParser.noOccurence should fail."
testStringParserFailure(keyworkLet, inputs: notMatching)
{ input, result in
@@ -1014,7 +1014,7 @@ class CombinatorTests: XCTestCase {
"<!-- A comment -->", "<!-- Un autre en français -->", "<!---->"
]
let errorMessage = "GenericParser.manyTill error."
let errorMessage = "GenericParser.manyTill should succeed."
testStringParserSuccess(comment, inputs: matching) { inputStr, result in
@@ -1039,7 +1039,7 @@ class CombinatorTests: XCTestCase {
let notMatching = [
"<!-- A comment ->", "<!-- Un autre en français", "<---->", "a"
]
let shouldFailMessage = "GenericParser.manyTill should have failed."
let shouldFailMessage = "GenericParser.manyTill should fail."
testStringParserFailure(comment, inputs: notMatching) { input, result in
@@ -1135,7 +1135,7 @@ class CombinatorTests: XCTestCase {
// Test when not matching.
let notMatching = ["\n", "\r", "\n\r", "a"]
let shouldFailMessage = "GenericParser.eof should have failed."
let shouldFailMessage = "GenericParser.eof should fail."
testStringParserFailure(eof, inputs: notMatching) { input, result in

View File

@@ -68,7 +68,7 @@ class ExpressionTests: XCTestCase {
var index = 0
let errorMessage = "OperatorTable.expressionParser did not succeed."
let errorMessage = "OperatorTable.expressionParser should succeed."
testStringParserSuccess(expr, inputs: matching) { input, result in

View File

@@ -19,7 +19,7 @@ class GenericParserTests: XCTestCase {
let intParser = GenericParser<String, (), Int>(result: int99)
let mappedParser = trans <^> intParser
let errorMessage = "GenericParser.map error."
let errorMessage = "GenericParser.map should succeed."
testParserSuccess(mappedParser) { input, result in
@@ -63,7 +63,7 @@ class GenericParserTests: XCTestCase {
let int1 = 1
let int1Parser = GenericParser<String, (), Int>(result: int1)
let errorMessage = "GenericParser.apply error."
let errorMessage = "GenericParser.apply should succeed."
let applyParser = curriedPlus <^> int99Parser <*> int1Parser
testParserSuccess(applyParser) { input, result in
@@ -118,7 +118,7 @@ class GenericParserTests: XCTestCase {
let letter = StringParser.oneOf("abc")
let alt1 = empty <|> letter
let errorMessage = "GenericParser.alternative error."
let errorMessage = "GenericParser.alternative should succeed."
testStringParserSuccess(alt1, inputs: ["adsf"]) { input, result in
@@ -169,7 +169,7 @@ class GenericParserTests: XCTestCase {
}
let matching = ["a1", "b0", "c9"]
let errorMessage = "GenericParser.flatMap error."
let errorMessage = "GenericParser.flatMap should succeed."
testStringParserSuccess(letterDigit, inputs: matching)
{ input, result in
@@ -195,7 +195,7 @@ class GenericParserTests: XCTestCase {
let attempt = string1.attempt <|> string2
let matching = ["asdfg", "asdfg123"]
let errorMessage = "GenericParser.attempt error."
let errorMessage = "GenericParser.attempt should succeed."
testStringParserSuccess(attempt, inputs: matching) { input, result in
@@ -222,7 +222,7 @@ class GenericParserTests: XCTestCase {
let lookAhead = string1.lookAhead *> string2
let matching = [longestMatch, longestMatch + "123"]
let errorMessage = "GenericParser.lookAhead error."
let errorMessage = "GenericParser.lookAhead should succeed."
testStringParserSuccess(lookAhead, inputs: matching) { input, result in
@@ -240,7 +240,7 @@ class GenericParserTests: XCTestCase {
// Test when not matching.
let notMatching = ["sad", "das", "asdasdfg"]
let shouldFailMessage = "GenericParser.lookAhead should have failed."
let shouldFailMessage = "GenericParser.lookAhead should fail."
testStringParserFailure(lookAhead, inputs: notMatching)
{ input, result in
@@ -261,7 +261,7 @@ class GenericParserTests: XCTestCase {
let manyString = StringParser.string("asdf").many
let matching = ["asdfasdf", "asdfasdfasdf", "asdfasdfasdfasdf", "xasdf"]
let errorMessage = "GenericParser.many error."
let errorMessage = "GenericParser.many should succeed."
testStringParserSuccess(manyString, inputs: matching) { input, result in
@@ -280,7 +280,7 @@ class GenericParserTests: XCTestCase {
// Test when not matching.
let notMatching = ["asd", "asdfasd"]
let shouldFailMessage = "GenericParser.many should have failed."
let shouldFailMessage = "GenericParser.many should fail."
testStringParserFailure(manyString, inputs: notMatching)
{ input, result in
@@ -306,7 +306,7 @@ class GenericParserTests: XCTestCase {
// Test when not matching.
let notMatching = ["asd", "asdfasd"]
let shouldFailMessage = "GenericParser.skipMany should have failed."
let shouldFailMessage = "GenericParser.skipMany should fail."
testStringParserFailure(skipManyString, inputs: notMatching)
{ input, result in
@@ -327,7 +327,7 @@ class GenericParserTests: XCTestCase {
let empty = StringParser.empty
let shouldFailMessage = "GenericParser.empty should have failed."
let shouldFailMessage = "GenericParser.empty should fail."
testStringParserFailure(empty, inputs: [""]) { input, result in
@@ -385,7 +385,7 @@ class GenericParserTests: XCTestCase {
if !containsExpected || !containsSystemUnexpected {
XCTFail("GenericParser.label error.")
XCTFail("GenericParser.label should succeed.")
}
@@ -409,7 +409,7 @@ class GenericParserTests: XCTestCase {
let add = GenericParser.lift2(-, parser1: left, parser2: right)
let errorMessage = "GenericParser.lift2 error."
let errorMessage = "GenericParser.lift2 should succeed."
testParserSuccess(add) { input, result in
let isMatch = result == leftNumber - rightNumber
@@ -443,7 +443,7 @@ class GenericParserTests: XCTestCase {
parser3: num3
)
let errorMessage = "GenericParser.lift3 error."
let errorMessage = "GenericParser.lift3 should succeed."
testParserSuccess(add) { input, result in
let isMatch = result == number1 - number2 - number3
@@ -480,7 +480,7 @@ class GenericParserTests: XCTestCase {
parser4: num4
)
let errorMessage = "GenericParser.lift4 error."
let errorMessage = "GenericParser.lift4 should succeed."
testParserSuccess(add) { input, result in
let isMatch = result == number1 - number2 - number3 - number4
@@ -520,7 +520,7 @@ class GenericParserTests: XCTestCase {
parser5: num5
)
let errorMessage = "GenericParser.lift4 error."
let errorMessage = "GenericParser.lift4 should succeed."
testParserSuccess(add) { input, result in
let isMatch =
@@ -550,7 +550,7 @@ class GenericParserTests: XCTestCase {
let matching = ["a1234H23A3A0à1234É5678ê0ç6ë7"]
let errorMessage = "GenericParser.updateUserState error."
let errorMessage = "GenericParser.updateUserState should succeed."
do {
@@ -592,7 +592,7 @@ class GenericParserTests: XCTestCase {
do {
let result = try parser.run(sourceName: "", input: charArray)
XCTAssert(result == charArray, "Array parse error.")
XCTAssert(result == charArray, "Array parse should succeed.")
} catch let parseError as ParseError {

View File

@@ -24,7 +24,7 @@ class PermutationTests: XCTestCase {
XCTAssertEqual(
permutation.count,
3,
"Permutation.count returned wrong value."
"Permutation.count should return 3."
)
permutation.replaceSubrange(0..<1, with: [])
@@ -32,7 +32,7 @@ class PermutationTests: XCTestCase {
XCTAssertEqual(
permutation.count,
2,
"Permutation.replaceRange did not remove first element."
"Permutation.replaceRange should remove first element."
)
}
@@ -51,7 +51,7 @@ class PermutationTests: XCTestCase {
// Test for success.
let matching = ["abc", "acb", "bac", "bca", "cab", "cba"]
let errorMessage = "Permutation.parser did not succeed."
let errorMessage = "Permutation.parser should succeed."
testStringParserSuccess(parser, inputs: matching) { input, result in
@@ -72,7 +72,7 @@ class PermutationTests: XCTestCase {
"bc", "cb", "ac", "ca", "ab", "ba", "aaa", "aab", "aac", "bbb",
"bba", "bbc", "ccc", "cca", "ccb"
]
let shouldFailMessage = "Permutation.parser should have failed."
let shouldFailMessage = "Permutation.parser should fail."
testStringParserFailure(parser, inputs: notMatching) { input, result in
@@ -103,7 +103,7 @@ class PermutationTests: XCTestCase {
// Test for success.
let matching = ["a,b,c", "a,c,b", "b,a,c", "b,c,a", "c,a,b", "c,b,a"]
let errorMessage = "Permutation.parserWithSeparator did not succeed."
let errorMessage = "Permutation.parserWithSeparator should succeed."
testStringParserSuccess(parser, inputs: matching) { input, result in
@@ -122,7 +122,7 @@ class PermutationTests: XCTestCase {
// Test for failure.
let notMatching = ["ab,c", "a,cb", ",b,a,c", "bca"]
let shouldFailMessage =
"Permutation.parserWithSeparator should have failed."
"Permutation.parserWithSeparator should fail."
testStringParserFailure(parser, inputs: notMatching) { input, result in
@@ -163,7 +163,7 @@ class PermutationTests: XCTestCase {
let expected3 = "_bc"
let test3 = (matching3, expected3)
let errorMessage = "Permutation.parser did not succeed."
let errorMessage = "Permutation.parser should succeed."
for (matching, expected) in [test1, test2, test3] {
@@ -185,7 +185,7 @@ class PermutationTests: XCTestCase {
// Test for failure.
let notMatching = ["ac", "ca", "zbc"]
let shouldFailMessage = "Permutation.parser should have failed."
let shouldFailMessage = "Permutation.parser should fail."
testStringParserFailure(parser, inputs: notMatching) { input, result in
@@ -226,7 +226,7 @@ class PermutationTests: XCTestCase {
let expected2 = "a_cd"
let test2 = (matching2, expected2)
let errorMessage = "Permutation.parser did not succeed."
let errorMessage = "Permutation.parser should succeed."
for (matching, expected) in [test1, test2] {
@@ -248,7 +248,7 @@ class PermutationTests: XCTestCase {
// Test for failure.
let notMatching = ["abcd", "acd", "ab,c,d", "abd", "cda", "dad"]
let shouldFailMessage = "Permutation.parser should have failed."
let shouldFailMessage = "Permutation.parser should fail."
testStringParserFailure(parser, inputs: notMatching) { input, result in
@@ -321,7 +321,7 @@ class PermutationTests: XCTestCase {
["test.jpg", "A test image", "A long description", "120", "12"],
]
let errorMessage = "Permutation.parser did not succeed."
let errorMessage = "Permutation.parser should succeed."
var index = 0
testStringParserSuccess(imgTag, inputs: matching) { input, result in
@@ -344,7 +344,7 @@ class PermutationTests: XCTestCase {
"<imgwidth=\"12\" longdesc=\"A long description\" " +
"alt=\"A test image\" height=\"120\" />"
]
let shouldFailMessage = "Permutation.parser should have failed."
let shouldFailMessage = "Permutation.parser should fail."
testStringParserFailure(imgTag, inputs: notMatching) { input, result in

View File

@@ -17,13 +17,13 @@ class StringTests: XCTestCase {
XCTAssertEqual(
"4",
str.last!,
"`str.last` should have returned \"4\"."
"`str.last` should return \"4\"."
)
let emptyStr = ""
XCTAssertNil(
emptyStr.last,
"`emptyStr.last` should have returned `nil`."
"`emptyStr.last` should return `nil`."
)
}

View File

@@ -39,7 +39,7 @@ class TokenTests: XCTestCase {
(swiftIdentifier, swiftMatching), (identifier, matching)
]
let errorMessage = "GenericTokenParser.identifier did not succeed."
let errorMessage = "GenericTokenParser.identifier should succeed."
for (parser, inputs) in parsersAssociation {
@@ -64,7 +64,7 @@ class TokenTests: XCTestCase {
let notMatching = swift.reservedNames
let shouldFailMessage =
"GenericTokenParser.identifier should have failed."
"GenericTokenParser.identifier should fail."
testStringParserFailure(swiftIdentifier, inputs: notMatching)
{ input, result in
@@ -98,7 +98,7 @@ class TokenTests: XCTestCase {
]
let errorMessage =
"GenericTokenParser.identifier did not succeed."
"GenericTokenParser.identifier should succeed."
testStringParserSuccess(identifier, inputs: matching)
{ input, result in
@@ -121,7 +121,7 @@ class TokenTests: XCTestCase {
notMatchingLower.map { $0.uppercased() }
let shouldFailMessage =
"GenericTokenParser.identifier should have failed."
"GenericTokenParser.identifier should fail."
testStringParserFailure(identifier, inputs: notMatching)
{ input, result in
@@ -176,7 +176,7 @@ class TokenTests: XCTestCase {
let notMatching = matching.map { $0 + "Test" }
let notMatchingAssociation = zip(reservedNames, notMatching)
let shouldFailMessage =
"GenericTokenParser.reservedName should have failed."
"GenericTokenParser.reservedName should fail."
for (parser, noMatch) in notMatchingAssociation {
@@ -209,7 +209,7 @@ class TokenTests: XCTestCase {
"^>", "?>", "~>"
]
let errorMessage = "GenericTokenParser.legalOperator did not succeed."
let errorMessage = "GenericTokenParser.legalOperator should succeed."
testStringParserSuccess(legalOperator, inputs: matching)
{input, result in
@@ -229,7 +229,7 @@ class TokenTests: XCTestCase {
// Test when not matching.
let notMatching = swift.reservedOperators
let shouldFailMessage =
"GenericTokenParser.legalOperator should have failed."
"GenericTokenParser.legalOperator should fail."
testStringParserFailure(legalOperator, inputs: notMatching)
{ input, result in
@@ -269,7 +269,7 @@ class TokenTests: XCTestCase {
let notMatchingAssociation = zip(reservedOperators, notMatching)
let shouldFailMessage =
"GenericTokenParser.reservedOperator should have failed."
"GenericTokenParser.reservedOperator should fail."
for (parser, noMatch) in notMatchingAssociation {
@@ -307,7 +307,7 @@ class TokenTests: XCTestCase {
var index = 0
let errorMessage =
"GenericTokenParser.characterLiteral did not succeed."
"GenericTokenParser.characterLiteral should succeed."
testStringParserSuccess(characterLiteral, inputs: matching)
{ input, result in
@@ -332,7 +332,7 @@ class TokenTests: XCTestCase {
]
let shouldFailMessage =
"GenericTokenParser.characterLiteral should have failed."
"GenericTokenParser.characterLiteral should fail."
testStringParserFailure(characterLiteral, inputs: notMatching)
{ input, result in
@@ -369,7 +369,7 @@ class TokenTests: XCTestCase {
var index = 0
let errorMessage =
"GenericTokenParser.stringLiteral did not succeed."
"GenericTokenParser.stringLiteral should succeed."
testStringParserSuccess(stringLiteral, inputs: matching)
{ input, result in
@@ -394,7 +394,7 @@ class TokenTests: XCTestCase {
]
let shouldFailMessage =
"GenericTokenParser.stringLiteral should have failed."
"GenericTokenParser.stringLiteral should fail."
testStringParserFailure(stringLiteral, inputs: notMatching)
{ input, result in
@@ -427,7 +427,7 @@ class TokenTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericTokenParser.stringLiteral did not succeed."
let errorMessage = "GenericTokenParser.stringLiteral should succeed."
testStringParserSuccess(stringLiteral, inputs: matching)
{ input, result in
@@ -452,7 +452,7 @@ class TokenTests: XCTestCase {
]
let shouldFailMessage =
"GenericTokenParser.stringLiteral should have failed."
"GenericTokenParser.stringLiteral should fail."
testStringParserFailure(stringLiteral, inputs: notMatching)
{ input, result in
@@ -487,7 +487,7 @@ class TokenTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericTokenParser.stringLiteral did not succeed."
let errorMessage = "GenericTokenParser.stringLiteral should succeed."
testStringParserSuccess(stringLiteral, inputs: matching)
{ input, result in
@@ -512,7 +512,7 @@ class TokenTests: XCTestCase {
]
let shouldFailMessage =
"GenericTokenParser.stringLiteral should have failed."
"GenericTokenParser.stringLiteral should fail."
testStringParserFailure(stringLiteral, inputs: notMatching)
{ input, result in
@@ -541,7 +541,7 @@ class TokenTests: XCTestCase {
let expected = [1, 1234, 0xF, 0xF, 0xFFFF, 0xFFFF, 0o1, 0o1234, 0]
var index = 0
let errorMessage = "GenericTokenParser.natural did not succeed."
let errorMessage = "GenericTokenParser.natural should succeed."
testStringParserSuccess(natural, inputs: matching) { input, result in
@@ -565,7 +565,7 @@ class TokenTests: XCTestCase {
]
let shouldFailMessage =
"GenericTokenParser.natural should have failed."
"GenericTokenParser.natural should fail."
testStringParserFailure(natural, inputs: notMatching) { input, result in
@@ -598,7 +598,7 @@ class TokenTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericTokenParser.integer did not succeed."
let errorMessage = "GenericTokenParser.integer should succeed."
testStringParserSuccess(integer, inputs: matching) { input, result in
@@ -621,7 +621,7 @@ class TokenTests: XCTestCase {
"+FFFF", "-o1", "+o1234"
]
let shouldFailMessage = "GenericTokenParser.integer should have failed."
let shouldFailMessage = "GenericTokenParser.integer should fail."
testStringParserFailure(integer, inputs: notMatching) { input, result in
@@ -655,7 +655,7 @@ class TokenTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericTokenParser.integerAsFloat did not succeed."
let errorMessage = "GenericTokenParser.integerAsFloat should succeed."
testStringParserSuccess(integer, inputs: matching) { input, result in
@@ -679,7 +679,7 @@ class TokenTests: XCTestCase {
]
let shouldFailMessage =
"GenericTokenParser.integerAsFloat should have failed."
"GenericTokenParser.integerAsFloat should fail."
testStringParserFailure(integer, inputs: notMatching) { input, result in
@@ -712,7 +712,7 @@ class TokenTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericTokenParser.float did not succeed."
let errorMessage = "GenericTokenParser.float should succeed."
testStringParserSuccess(float, inputs: matching) { input, result in
@@ -735,7 +735,7 @@ class TokenTests: XCTestCase {
"o1", "o1234", "-xf", "+xF", "-ffff", "+FFFF", "-o1", "+o1234"
]
let shouldFailMessage = "GenericTokenParser.float should have failed."
let shouldFailMessage = "GenericTokenParser.float should fail."
testStringParserFailure(float, inputs: notMatching) { input, result in
@@ -776,7 +776,7 @@ class TokenTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericTokenParser.number did not succeed."
let errorMessage = "GenericTokenParser.number should succeed."
testStringParserSuccess(number, inputs: matching) { input, result in
@@ -818,7 +818,7 @@ class TokenTests: XCTestCase {
"xf", "xF", "ffff", "FFFF", "o1", "o1234", "-xf", "+xF", "-ffff",
"+FFFF", "-o1", "+o1234"
]
let shouldFailMessage = "GenericTokenParser.number should have failed."
let shouldFailMessage = "GenericTokenParser.number should fail."
testStringParserFailure(number, inputs: notMatching) { input, result in
@@ -843,7 +843,7 @@ class TokenTests: XCTestCase {
let expected = [1, 1234, 001234]
var index = 0
let errorMessage = "GenericTokenParser.decimal did not succeed."
let errorMessage = "GenericTokenParser.decimal should succeed."
testStringParserSuccess(decimal, inputs: matching) { input, result in
@@ -866,7 +866,7 @@ class TokenTests: XCTestCase {
"-0o1", "-0o1234", "99999999999999999999999999"
]
let shouldFailMessage = "GenericTokenParser.decimal should have failed."
let shouldFailMessage = "GenericTokenParser.decimal should fail."
testStringParserFailure(decimal, inputs: notMatching) { input, result in
@@ -895,7 +895,7 @@ class TokenTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericTokenParser.hexadecimal did not succeed."
let errorMessage = "GenericTokenParser.hexadecimal should succeed."
testStringParserSuccess(hexadecimal, inputs: matching)
{ input, result in
@@ -919,7 +919,7 @@ class TokenTests: XCTestCase {
"+0xFFFF", "-0o1", "-0o1234", "xFFFFFFFFFFFFFFFFFFFFFFFFFF"
]
let shouldFailMessage =
"GenericTokenParser.hexadecimal should have failed."
"GenericTokenParser.hexadecimal should fail."
testStringParserFailure(hexadecimal, inputs: notMatching)
{ input, result in
@@ -945,7 +945,7 @@ class TokenTests: XCTestCase {
let expected = [0o1, 0o1234, 0o567]
var index = 0
let errorMessage = "GenericTokenParser.octal did not succeed."
let errorMessage = "GenericTokenParser.octal should succeed."
testStringParserSuccess(octal, inputs: matching) { input, result in
@@ -969,7 +969,7 @@ class TokenTests: XCTestCase {
"o777777777777777777777777777777777777"
]
let shouldFailMessage = "GenericTokenParser.octal should have failed."
let shouldFailMessage = "GenericTokenParser.octal should fail."
testStringParserFailure(octal, inputs: notMatching) { input, result in
@@ -1000,7 +1000,7 @@ class TokenTests: XCTestCase {
]
var index = 0
let errorMessage = "GenericTokenParser.symbol did not succeed."
let errorMessage = "GenericTokenParser.symbol should succeed."
for (parser, input) in zip(symbols, matching) {
@@ -1053,7 +1053,7 @@ class TokenTests: XCTestCase {
]
]
let errorMessage = "GenericTokenParser.whiteSpace did not succeed."
let errorMessage = "GenericTokenParser.whiteSpace should succeed."
for (parser, input) in zip(matchingParsers, matching) {
@@ -1112,7 +1112,7 @@ class TokenTests: XCTestCase {
]
let shouldFailMessage =
"GenericTokenParser.whiteSpace should have failed."
"GenericTokenParser.whiteSpace should fail."
for (parser, input) in zip(notMatchingParsers, notMatching) {
@@ -1194,7 +1194,7 @@ class TokenTests: XCTestCase {
let parsers = [lexer.semicolon, lexer.comma, lexer.colon, lexer.dot]
let matching = [";", ",", ":", "."]
let errorMessage = "One of the punctuation parsers did not succeed."
let errorMessage = "One of the punctuation parsers should succeed."
for (parser, match) in zip(parsers, matching) {
@@ -1286,7 +1286,7 @@ class TokenTests: XCTestCase {
]
let errorMessage =
"GenericTokenParser." + parserName + " did not succeed."
"GenericTokenParser." + parserName + " should succeed."
testStringParserSuccess(brackets, inputs: matching) { input, result in
@@ -1308,7 +1308,7 @@ class TokenTests: XCTestCase {
opening + " \n\t\rabcd /* */ ", opening + closing
]
let shouldFailMessage =
"GenericTokenParser." + parserName + " should have failed."
"GenericTokenParser." + parserName + " should fail."
testStringParserFailure(brackets, inputs: notMatching)
{ input, result in
@@ -1350,7 +1350,7 @@ class TokenTests: XCTestCase {
if allowZeroOccurence { matching.append("") }
let errorMessage =
"GenericTokenParser." + parserName + " did not succeed."
"GenericTokenParser." + parserName + " should succeed."
testStringParserSuccess(sepBy, inputs: matching) { input, result in
@@ -1371,7 +1371,7 @@ class TokenTests: XCTestCase {
if !allowZeroOccurence { notMatching.append("") }
let shouldFailMessage =
"GenericTokenParser." + parserName + " should have failed."
"GenericTokenParser." + parserName + " should fail."
testStringParserFailure(sepBy, inputs: notMatching) { input, result in