mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
Cover skipping BOM with test.
This commit is contained in:
parent
f37d0e13d3
commit
1d782338c9
@ -352,6 +352,18 @@ TEST_CASE("Functor cast")
|
||||
CHECK(d == 3 * 6);
|
||||
}
|
||||
|
||||
TEST_CASE("BOM at beginning of string")
|
||||
{
|
||||
chaiscript::ChaiScript_Basic chai(create_chaiscript_stdlib(),create_chaiscript_parser());
|
||||
|
||||
chai.add(chaiscript::fun(&functor_cast_test_call), "test_call");
|
||||
|
||||
chai.eval("def func() { return \"Hello World\"; };");
|
||||
|
||||
std::string result = chai.eval<std::string>("\xef\xbb\xbf(func())");
|
||||
|
||||
CHECK(result.compare(std::string("Hello World")) == 0);
|
||||
}
|
||||
|
||||
|
||||
int set_state_test_myfun()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user