On Tue, 2024-10-29 at 19:19 -0400, David Malcolm wrote:
> +static void
> +test_output_arg_parsing ()
> +{
> +  auto_fix_quotes fix_quotes;
> +  auto_fix_progname fix_progname;
> +
> +  /* Minimal correct example.  */
> +  {
> +    parser_test pt;
> +    auto result = pt.parse ("foo");
> +    ASSERT_EQ (result->m_format, "foo");
> +    ASSERT_EQ (result->m_kvs.size (), 0);
> +    ASSERT_FALSE (pt.execution_failed_p ());
> +  }
> +
> +  /* Stray trailing colon with no key/value pairs.  */
> +  {
> +    parser_test pt;
> +    auto result = pt.parse ("foo:");
> +    ASSERT_EQ (result, nullptr);
> +    ASSERT_TRUE (pt.execution_failed_p ());
> +    ASSERT_STREQ (pt.get_diagnostic_text (),
> +               "PROGNAME: error: `-fOPTION=foo:':"
> +               " expected KEY=VALUE-style parameter for format `foo'"
> +               " after `:';"
> +               " got `'\n");
> +  }

Hi David,

Unfortunately this test fails with LANG=zh_CN.UTF-8, breaking bootstrap:

../../gcc-upstream/gcc/opts-diagnostic.cc:599: test_output_arg_parsing: FAIL: 
ASSERT_STREQ (pt.get_diagnostic_text (), "PROGNAME: error: `-fOPTION=foo:':" " 
expected KEY=VALUE-style parameter for format `foo'" " after `:';" " got `'\n")
 val1="PROGNAME: 错误:`-fOPTION=foo:': expected KEY=VALUE-style parameter for 
format `foo' after `:'; got `'
"
 val2="PROGNAME: error: `-fOPTION=foo:': expected KEY=VALUE-style parameter for 
format `foo' after `:'; got `'
"

("错误" just means "error" in Chinese.)

I'm not sure what the best way is to fix the issue.

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to