MCPcopy Create free account
hub / github.com/argotorg/solidity / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

test/yulPhaser/Program.cpp:62–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60BOOST_AUTO_TEST_SUITE(ProgramTest)
61
62BOOST_AUTO_TEST_CASE(copy_constructor_should_make_deep_copy_of_ast)
63{
64 std::string sourceCode(
65 "{\n"
66 " let x := 1\n"
67 "}\n"
68 );
69 CharStream sourceStream(sourceCode, current_test_case().p_name);
70 Program program = get<Program>(Program::load(sourceStream));
71
72 Program programCopy(program);
73
74 BOOST_TEST(&programCopy.ast() != &program.ast());
75
76 // There might be a more direct way to compare ASTs but converting to JSON should be good enough
77 // as long as the conversion is deterministic. A very nice side effect of doing it this way is
78 // that BOOST_TEST will print the complete AST structure of both programs in case of a mismatch.
79 BOOST_TEST(programCopy.toJson() == program.toJson());
80}
81
82BOOST_AUTO_TEST_CASE(load_should_rewind_the_stream)
83{

Callers

nothing calls this directly

Calls 10

jsonParseStrictFunction · 0.85
strMethod · 0.80
codeSizeFunction · 0.50
toStringFunction · 0.50
toJsonMethod · 0.45
setPositionMethod · 0.45
sizeMethod · 0.45
optimiseMethod · 0.45
emptyMethod · 0.45
codeSizeMethod · 0.45

Tested by

no test coverage detected