hpb/oss: replace trigraph test with escaped string test
This allows us to remove trigraph enabling in hpb ci as well :)
PiperOrigin-RevId: 808144179
diff --git a/.github/workflows/test_hpb.yml b/.github/workflows/test_hpb.yml
index 1bd6bf6..e8bc9b4 100644
--- a/.github/workflows/test_hpb.yml
+++ b/.github/workflows/test_hpb.yml
@@ -39,5 +39,5 @@
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: hpb_linux
bazel: >-
- ${{ matrix.bazel_cmd }} --cxxopt=-Wno-trigraphs
+ ${{ matrix.bazel_cmd }}
${{ matrix.targets }} ${{ matrix.config.flags }}
diff --git a/hpb_generator/tests/extension_test.cc b/hpb_generator/tests/extension_test.cc
index 3342dc3..82cb0c8 100644
--- a/hpb_generator/tests/extension_test.cc
+++ b/hpb_generator/tests/extension_test.cc
@@ -39,8 +39,8 @@
using ::hpb_unittest::someotherpackage::protos::repeated_int32_ext;
using ::hpb_unittest::someotherpackage::protos::repeated_int64_ext;
using ::hpb_unittest::someotherpackage::protos::repeated_string_ext;
+using ::hpb_unittest::someotherpackage::protos::string_escape_ext;
using ::hpb_unittest::someotherpackage::protos::string_ext;
-using ::hpb_unittest::someotherpackage::protos::string_trigraph_ext;
using ::hpb_unittest::someotherpackage::protos::uint32_ext;
using ::hpb_unittest::someotherpackage::protos::uint64_ext;
@@ -392,11 +392,11 @@
EXPECT_THAT(res, IsOkAndHolds("mishpacha"));
}
-TEST(CppGeneratedCode, GetExtensionStringWithDefaultAndTrigraph) {
+TEST(CppGeneratedCode, GetExtensionStringWithDefaultAndTestEscaping) {
TestModel model;
- auto res = hpb::GetExtension(&model, string_trigraph_ext);
+ auto res = hpb::GetExtension(&model, string_escape_ext);
EXPECT_TRUE(res.ok());
- EXPECT_THAT(res, IsOkAndHolds("bseder??!bseder"));
+ EXPECT_THAT(res, IsOkAndHolds("bseder\"bseder"));
}
TEST(CppGeneratedCode, GetExtensionOnMutableChild) {
diff --git a/hpb_generator/tests/test_extension.proto b/hpb_generator/tests/test_extension.proto
index f45d61c..c4a6490 100644
--- a/hpb_generator/tests/test_extension.proto
+++ b/hpb_generator/tests/test_extension.proto
@@ -34,5 +34,5 @@
bool bool_ext = 13011 [default = true];
string string_ext = 13012 [default = "mishpacha"];
- string string_trigraph_ext = 13013 [default = "bseder??!bseder"];
+ string string_escape_ext = 13013 [default = "bseder\"bseder"];
}