Skip to content

Commit

Permalink
Add test to make sure \r\n is tokenized the same as \n
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Jun 29, 2024
1 parent eec3dec commit c43763f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ int main(int argc, char** argv)
assert(compare_token_posinfo(actual, expected) == true);
}

{
// Make sure \r\n is tokenized the same as \n (because \r is just ignored as it's not a known token)
TIVarFile testPrgm = TIVarFile::createNew("Program", "TEST1");
testPrgm.setContentFromString("Pause 1\nPause 1");
TIVarFile testPrgm2 = TIVarFile::createNew("Program", "TEST2");
testPrgm2.setContentFromString("Pause 1\r\nPause 1");
assert(testPrgm.getRawContentHexStr() == testPrgm2.getRawContentHexStr());
}

{
// Test lower alpha being the expected lowercase tokens, not special-meaning ones
TIVarFile testPrgm = TIVarFile::createNew("Program", "INTERP");
Expand Down

0 comments on commit c43763f

Please sign in to comment.