1
-
1
+
2
2
#define CATCH_CONFIG_MAIN
3
3
#include " catch.hpp"
4
4
9
9
TEST_CASE (" Simple syntax test (with unicode)" , " [general]" )
10
10
{
11
11
peg::parser parser (
12
- " ROOT ← _ "
12
+ u8 " ROOT ← _ "
13
13
" _ <- ' ' "
14
14
);
15
15
@@ -809,7 +809,7 @@ TEST_CASE("Semantic predicate test", "[predicate]")
809
809
810
810
TEST_CASE (" Japanese character" , " [unicode]" )
811
811
{
812
- peg::parser parser (R "(
812
+ peg::parser parser (u8R "(
813
813
文 <- 修飾語? 主語 述語 '。'
814
814
主語 <- 名詞 助詞
815
815
述語 <- 動詞 助詞
@@ -820,7 +820,7 @@ TEST_CASE("Japanese character", "[unicode]")
820
820
助詞 <- 'が' / 'を' / 'た' / 'ます' / 'に'
821
821
)" );
822
822
823
- auto ret = parser.parse (R "( サーバーを復旧します。)" );
823
+ auto ret = parser.parse (u8R "( サーバーを復旧します。)" );
824
824
825
825
REQUIRE (ret == true );
826
826
}
@@ -846,7 +846,7 @@ TEST_CASE("PEG Definition", "[peg]")
846
846
auto g = ParserGenerator::grammar ();
847
847
REQUIRE (exact (g, " Definition" , " Definition <- a / (b c) / d " ) == true );
848
848
REQUIRE (exact (g, " Definition" , " Definition <- a / b c / d " ) == true );
849
- REQUIRE (exact (g, " Definition" , " Definitiond ← a " ) == true );
849
+ REQUIRE (exact (g, " Definition" , u8 " Definitiond ← a " ) == true );
850
850
REQUIRE (exact (g, " Definition" , " Definition " ) == false );
851
851
REQUIRE (exact (g, " Definition" , " " ) == false );
852
852
REQUIRE (exact (g, " Definition" , " " ) == false );
@@ -962,7 +962,7 @@ TEST_CASE("PEG Literal", "[peg]")
962
962
REQUIRE (exact (g, " Literal" , " \" '\" abc\" '\" " ) == false );
963
963
REQUIRE (exact (g, " Literal" , " abc" ) == false );
964
964
REQUIRE (exact (g, " Literal" , " " ) == false );
965
- REQUIRE (exact (g, " Literal" , " 日本語" ) == false );
965
+ REQUIRE (exact (g, " Literal" , u8 " 日本語" ) == false );
966
966
}
967
967
968
968
TEST_CASE (" PEG Class" , " [peg]" )
@@ -980,7 +980,7 @@ TEST_CASE("PEG Class", "[peg]")
980
980
REQUIRE (exact (g, " Class" , " [a" ) == false );
981
981
REQUIRE (exact (g, " Class" , " ]" ) == false );
982
982
REQUIRE (exact (g, " Class" , " a]" ) == false );
983
- REQUIRE (exact (g, " Class" , " あ-ん" ) == false );
983
+ REQUIRE (exact (g, " Class" , u8 " あ-ん" ) == false );
984
984
REQUIRE (exact (g, " Class" , " [-+]" ) == true );
985
985
REQUIRE (exact (g, " Class" , " [+-]" ) == false );
986
986
}
@@ -1026,7 +1026,7 @@ TEST_CASE("PEG Char", "[peg]")
1026
1026
REQUIRE (exact (g, " Char" , " " ) == true );
1027
1027
REQUIRE (exact (g, " Char" , " " ) == false );
1028
1028
REQUIRE (exact (g, " Char" , " " ) == false );
1029
- REQUIRE (exact (g, " Char" , " あ" ) == false );
1029
+ REQUIRE (exact (g, " Char" , u8 " あ" ) == false );
1030
1030
}
1031
1031
1032
1032
TEST_CASE (" PEG Operators" , " [peg]" )
0 commit comments