diff --git a/.github/mingw-w64-x86_64.cmake b/.github/mingw-w64-x86_64.cmake new file mode 100644 index 00000000..2f22e13d --- /dev/null +++ b/.github/mingw-w64-x86_64.cmake @@ -0,0 +1,16 @@ +set(CMAKE_SYSTEM_NAME Windows) +set(TOOLCHAIN_PREFIX x86_64-w64-mingw32) + +# cross compilers to use for C, C++ and Fortran +set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) +set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) +set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) +set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) + +# target environment on the build host system +set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) + +# modify default behavior of FIND_XXX() commands +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/test/test_scalar_dquoted.cpp b/test/test_scalar_dquoted.cpp index 8b90d83b..6f77ce98 100644 --- a/test/test_scalar_dquoted.cpp +++ b/test/test_scalar_dquoted.cpp @@ -405,6 +405,26 @@ INSTANTIATE_TEST_SUITE_P(double_quoted_filter, //----------------------------------------------------------------------------- +TEST(double_quoted, issue486) +{ + csubstr srcs[] = { + "foo: \"test,\nbar\"", // this is invalid YAML, but ryml can parse it (but won't in the future) + "foo: \"test,\n bar\"" // ... this is valid + }; + auto check = [](Tree const &t){ + ASSERT_TRUE(t.rootref().is_map()); + ASSERT_TRUE(t.rootref().has_child("foo")); + ASSERT_TRUE(t["foo"].has_val()); + ASSERT_TRUE(t["foo"].is_val_dquo()); + ASSERT_EQ(t["foo"].val(), "test, bar"); + }; + for(csubstr src : srcs) + { + check(parse_in_arena(src)); + test_check_emit_check(src, check); + } +} + TEST(double_quoted, leading_whitespace) { csubstr val = "\n \tfoo";