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 28, 2024
1 parent e5c0b7f commit e8e6d7a
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 @@ -22,7 +22,8 @@ enum Input {
Stringstream,
Fstream,
File,
String
String,
CharBuffer
};

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

Expand Down Expand Up @@ -140,6 +143,8 @@ static simplecpp::TokenList makeTokenList(const char code[], std::size_t size, s
const std::string code_s(code, size);
return simplecpp::TokenList(code_s, filenames, filename, outputList);
}
case CharBuffer:
return simplecpp::TokenList(code, size, filenames, filename, outputList);
}
}

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

0 comments on commit e8e6d7a

Please sign in to comment.