Skip to content

Commit

Permalink
test.cpp: test with char buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Mar 29, 2024
1 parent 09eeea4 commit 5d99779
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
enum Input {
Stringstream,
Fstream,
File
File,
CharBuffer
};

static Input USE_INPUT = Stringstream;
Expand Down Expand Up @@ -49,6 +50,8 @@ static const char* inputString(Input input) {
return "Fstream";
case File:
return "File";
case CharBuffer:
return "CharBuffer";
}
}

Expand Down Expand Up @@ -133,6 +136,8 @@ static simplecpp::TokenList makeTokenList(const char code[], std::size_t size, s
return makeTokenListFromFstream(code, size, filenames, filename, outputList);
case File:
return makeTokenListFromFile(code, size, filenames, filename, outputList);
case CharBuffer:
return simplecpp::TokenList(code, size, filenames, filename, outputList);
}
}

Expand Down Expand Up @@ -3023,5 +3028,6 @@ int main(int argc, char **argv)
runTests(argc, argv, Stringstream);
runTests(argc, argv, Fstream);
runTests(argc, argv, File);
runTests(argc, argv, CharBuffer);
return numberOfFailedAssertions > 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}

0 comments on commit 5d99779

Please sign in to comment.