fix: restore the back compat of format_error

the following code was okay in the last release
```
toml::format_error("[test]", v, "test", {"hint1", "hint2"})
```
but was not okay in the current master. This commit fixes this.

cons: By this, the number of values to show is limited upto 3.
This commit is contained in:
ToruNiina
2019-03-20 20:46:22 +09:00
parent 4c13085b35
commit 5aebd6b562
2 changed files with 32 additions and 30 deletions

View File

@@ -22,7 +22,7 @@ BOOST_AUTO_TEST_CASE(test_1_value)
{
const std::string pretty_error =
toml::format_error("[error] test error", val, "this is a value",
std::vector<std::string>{"this is a hint"});
{"this is a hint"});
std::cout << pretty_error << std::endl;
}
}
@@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(test_2_values)
toml::format_error("[error] test error with two values",
v1, "this is the answer",
v2, "this is the pi",
std::vector<std::string>{"hint"});
{"hint"});
std::cout << pretty_error << std::endl;
}
}
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE(test_3_values)
v1, "this is the answer",
v2, "this is the pi",
v3, "this is a meta-syntactic variable",
std::vector<std::string>{"hint 1", "hint 2"});
{"hint 1", "hint 2"});
std::cout << pretty_error << std::endl;
}
}