File tree 3 files changed +16
-6
lines changed
3 files changed +16
-6
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 6
6
7
7
\*******************************************************************/
8
8
9
+ #include < fstream>
9
10
#include < json/json_parser.h>
10
11
#include < testing-utils/catch.hpp>
11
12
#include < testing-utils/message.h>
13
+ #include < util/tempfile.h>
12
14
13
15
SCENARIO (" Loading JSON files" )
14
16
{
15
17
GIVEN (" A invalid JSON file and a valid JSON file" )
16
18
{
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 << " {\n "
26
+ << " \" hello\" : \" world\"\n "
27
+ << " }\n " ;
28
+ }
29
+ {
30
+ std::ofstream invalid_json_out (invalid_json_path);
31
+ invalid_json_out << " foo\n " ;
32
+ }
19
33
20
34
WHEN (" Loading the invalid JSON file" )
21
35
{
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments