File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99#include < json/json_parser.h>
1010#include < testing-utils/catch.hpp>
1111#include < testing-utils/message.h>
12+ #include < util/tempfile.h>
13+ #include < fstream>
1214
1315SCENARIO (" Loading JSON files" )
1416{
1517 GIVEN (" A invalid JSON file and a valid JSON file" )
1618 {
17- const std::string valid_json_path = " ./json/valid.json" ;
18- const std::string invalid_json_path = " ./json/invalid.json" ;
19+ temporary_filet valid_json_file (" cbmc_unit_json_parser_valid" , " .json" );
20+ temporary_filet invalid_json_file (" cbmc_unit_json_parser_invalid" , " .json" );
21+ const std::string valid_json_path = valid_json_file ();
22+ const std::string invalid_json_path = invalid_json_file ();
23+ {
24+ std::ofstream valid_json_out (valid_json_path);
25+ valid_json_out
26+ << " {\n "
27+ << " \" hello\" : \" world\"\n "
28+ << " }\n " ;
29+ }
30+ {
31+ std::ofstream invalid_json_out (invalid_json_path);
32+ invalid_json_out
33+ << " foo\n " ;
34+ }
1935
2036 WHEN (" Loading the invalid JSON file" )
2137 {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments