Skip to content

Commit

Permalink
Add failing test quoted number in string array
Browse files Browse the repository at this point in the history
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
  • Loading branch information
sloretz authored and ivanpauno committed Jun 21, 2019
1 parent b6f4bc9 commit 5adb4c0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initial_params_node:
ros__parameters:
sa1: ["Four", "score"]
sa2: ["and", "7"]
18 changes: 18 additions & 0 deletions rcl_yaml_param_parser/test/test_parse_yaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@ TEST(test_file_parser, correct_syntax) {
allocator.deallocate(path, allocator.state);
}

TEST(test_file_parser, string_array_with_quoted_number) {
rcutils_reset_error();
EXPECT_TRUE(rcutils_get_cwd(cur_dir, 1024));
char * test_path = rcutils_join_path(cur_dir, "test");
char * path = rcutils_join_path(test_path, "string_array_with_quoted_number.yaml");
fprintf(stderr, "cur_path: %s\n", path);
EXPECT_TRUE(rcutils_exists(path));
rcl_params_t * params_hdl = rcl_yaml_node_struct_init(allocator);
ASSERT_TRUE(params_hdl);
bool res = rcl_parse_yaml_file(path, params_hdl);
fprintf(stderr, "%s\n", rcutils_get_error_string_safe());
ASSERT_TRUE(res);
rcl_yaml_node_struct_print(params_hdl);
rcl_yaml_node_struct_fini(params_hdl);
free(test_path);
free(path);
}

TEST(test_file_parser, multi_ns_correct_syntax) {
rcutils_reset_error();
EXPECT_TRUE(rcutils_get_cwd(cur_dir, 1024));
Expand Down

0 comments on commit 5adb4c0

Please sign in to comment.