Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed May 20, 2024
1 parent 0d74114 commit 4f54940
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions test/test_emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ void test_emits(Tree const& t, id_type id, std::string const& expected, std::str
if(max_depth > 1)
{
EmitOptions opts = EmitOptions{}.max_depth(0);
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2buf([&](substr buf){ return emit_yaml(t, id, opts, buf); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2buf([&](substr buf){ return emit_json(t, id, opts, buf); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2file([&](FILE *f){ return emit_yaml(t, id, opts, f); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2file([&](FILE *f){ return emit_json(t, id, opts, f); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2stream([&](std::ostringstream &oss){ oss << as_yaml(t, id, opts); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2stream([&](std::ostringstream &oss){ oss << as_json(t, id, opts); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emitrs_yaml<std::string>(t, id, opts)); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emitrs_json<std::string>(t, id, opts)); });
ExpectError::do_check(&t, [&]{ return emit2buf([&](substr buf){ return emit_yaml(t, id, opts, buf); }); });
ExpectError::do_check(&t, [&]{ return emit2buf([&](substr buf){ return emit_json(t, id, opts, buf); }); });
ExpectError::do_check(&t, [&]{ return emit2file([&](FILE *f){ return emit_yaml(t, id, opts, f); }); });
ExpectError::do_check(&t, [&]{ return emit2file([&](FILE *f){ return emit_json(t, id, opts, f); }); });
ExpectError::do_check(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(t, id, opts); }); });
ExpectError::do_check(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(t, id, opts); }); });
ExpectError::do_check(&t, [&]{ return emitrs_yaml<std::string>(t, id, opts); });
ExpectError::do_check(&t, [&]{ return emitrs_json<std::string>(t, id, opts); });
}
}

Expand Down Expand Up @@ -264,14 +264,14 @@ void test_emits(Tree const& t, std::string const& expected, std::string const& e
if(max_depth > 1)
{
EmitOptions opts = EmitOptions{}.max_depth(0);
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2buf([&](substr buf){ return emit_yaml(t, opts, buf); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2buf([&](substr buf){ return emit_json(t, opts, buf); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2file([&](FILE *f){ return emit_yaml(t, opts, f); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2file([&](FILE *f){ return emit_json(t, opts, f); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2stream([&](std::ostringstream &oss){ oss << as_yaml(ConstNodeRef(&t), opts); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emit2stream([&](std::ostringstream &oss){ oss << as_json(ConstNodeRef(&t), opts); })); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emitrs_yaml<std::string>(t, opts)); });
ExpectError::do_check(&t, [&]{ C4_DONT_OPTIMIZE(emitrs_json<std::string>(t, opts)); });
ExpectError::do_check(&t, [&]{ return emit2buf([&](substr buf){ return emit_yaml(t, opts, buf); }); });
ExpectError::do_check(&t, [&]{ return emit2buf([&](substr buf){ return emit_json(t, opts, buf); }); });
ExpectError::do_check(&t, [&]{ return emit2file([&](FILE *f){ return emit_yaml(t, opts, f); }); });
ExpectError::do_check(&t, [&]{ return emit2file([&](FILE *f){ return emit_json(t, opts, f); }); });
ExpectError::do_check(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(ConstNodeRef(&t), opts); }); });
ExpectError::do_check(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(ConstNodeRef(&t), opts); }); });
ExpectError::do_check(&t, [&]{ return emitrs_yaml<std::string>(t, opts); });
ExpectError::do_check(&t, [&]{ return emitrs_json<std::string>(t, opts); });
}
}

Expand Down Expand Up @@ -312,14 +312,14 @@ void test_emits(ConstNodeRef n, std::string const& expected, std::string const&
if(max_depth > 1)
{
EmitOptions opts = EmitOptions{}.max_depth(0);
ExpectError::do_check(n.tree(), [&]{ C4_DONT_OPTIMIZE(emit2buf([&](substr buf){ return emit_yaml(n, opts, buf); })); });
ExpectError::do_check(n.tree(), [&]{ C4_DONT_OPTIMIZE(emit2buf([&](substr buf){ return emit_json(n, opts, buf); })); });
ExpectError::do_check(n.tree(), [&]{ C4_DONT_OPTIMIZE(emit2file([&](FILE *f){ return emit_yaml(n, opts, f); })); });
ExpectError::do_check(n.tree(), [&]{ C4_DONT_OPTIMIZE(emit2file([&](FILE *f){ return emit_json(n, opts, f); })); });
ExpectError::do_check(n.tree(), [&]{ C4_DONT_OPTIMIZE(emit2stream([&](std::ostringstream &oss){ oss << as_yaml(n, opts); })); });
ExpectError::do_check(n.tree(), [&]{ C4_DONT_OPTIMIZE(emit2stream([&](std::ostringstream &oss){ oss << as_json(n, opts); })); });
ExpectError::do_check(n.tree(), [&]{ C4_DONT_OPTIMIZE(emitrs_yaml<std::string>(n, opts)); });
ExpectError::do_check(n.tree(), [&]{ C4_DONT_OPTIMIZE(emitrs_json<std::string>(n, opts)); });
ExpectError::do_check(n.tree(), [&]{ return emit2buf([&](substr buf){ return emit_yaml(n, opts, buf); }); });
ExpectError::do_check(n.tree(), [&]{ return emit2buf([&](substr buf){ return emit_json(n, opts, buf); }); });
ExpectError::do_check(n.tree(), [&]{ return emit2file([&](FILE *f){ return emit_yaml(n, opts, f); }); });
ExpectError::do_check(n.tree(), [&]{ return emit2file([&](FILE *f){ return emit_json(n, opts, f); }); });
ExpectError::do_check(n.tree(), [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(n, opts); }); });
ExpectError::do_check(n.tree(), [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(n, opts); }); });
ExpectError::do_check(n.tree(), [&]{ return emitrs_yaml<std::string>(n, opts); });
ExpectError::do_check(n.tree(), [&]{ return emitrs_json<std::string>(n, opts); });
}
}
}
Expand Down

0 comments on commit 4f54940

Please sign in to comment.