[
https://issues.apache.org/jira/browse/THRIFT-6347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sylwester Lachiewicz updated THRIFT-6347:
-----------------------------------------
Description:
[thrift_test_parser_support.cc|https://github.com/apache/thrift/blob/master/compiler/cpp/tests/thrift_test_parser_support.cc#L114]
replaces {{clean_up_doctext}} with a function that returns its input, because
the real one lives in {{main.cc}}, which the test build cannot link. As a
result
[t_rb_generator_functional_tests.cc:61|https://github.com/apache/thrift/blob/master/compiler/cpp/tests/rb/t_rb_generator_functional_tests.cc#L61]
passes while asserting {{# * first line}} for a comment the compiler renders
as {{# first line}}:
{code}
/**
* first line
*
* second line
*/
struct Example { 1: string value }
{code}
{noformat}
$ thrift --gen rb repro.thrift && grep -A2 'first line' gen-rb/repro_types.rb
# first line
#
# second line
{noformat}
Moving {{clean_up_doctext}} to {{parse/parse.cc}}, which both builds compile,
lets the tests parse doc comments the way the compiler does and the assertion
can state the real output.
was:
[thrift_test_parser_support.cc|https://github.com/apache/thrift/blob/master/compiler/cpp/tests/thrift_test_parser_support.cc#L114]
replaces {{clean_up_doctext}} with a function that returns its input, because
the real one lives in {{main.cc}}, which the test build cannot link. As a
result
[t_rb_generator_functional_tests.cc:61|https://github.com/apache/thrift/blob/master/compiler/cpp/tests/rb/t_rb_generator_functional_tests.cc#L61]
passes while asserting {{# * first line}} for a comment the compiler renders
as {{# first line}}:
{code}
/**
* first line
*
* second line
*/
struct Example { 1: string value }
{code}
{noformat}
$ thrift --gen rb repro.thrift && sed -n 5,7p gen-rb/repro_types.rb
# first line
#
# second line
{noformat}
Moving {{clean_up_doctext}} to {{parse/parse.cc}}, which both builds compile,
lets the tests parse doc comments the way the compiler does and the assertion
can state the real output.
> Compiler tests stub clean_up_doctext, so the Ruby RDoc test asserts output
> the compiler never produces
> ------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-6347
> URL: https://issues.apache.org/jira/browse/THRIFT-6347
> Project: Thrift
> Issue Type: Bug
> Components: Compiler (General), Ruby - Compiler
> Affects Versions: 0.25.0
> Reporter: Sylwester Lachiewicz
> Priority: Trivial
>
> [thrift_test_parser_support.cc|https://github.com/apache/thrift/blob/master/compiler/cpp/tests/thrift_test_parser_support.cc#L114]
> replaces {{clean_up_doctext}} with a function that returns its input,
> because the real one lives in {{main.cc}}, which the test build cannot link.
> As a result
> [t_rb_generator_functional_tests.cc:61|https://github.com/apache/thrift/blob/master/compiler/cpp/tests/rb/t_rb_generator_functional_tests.cc#L61]
> passes while asserting {{# * first line}} for a comment the compiler
> renders as {{# first line}}:
> {code}
> /**
> * first line
> *
> * second line
> */
> struct Example { 1: string value }
> {code}
> {noformat}
> $ thrift --gen rb repro.thrift && grep -A2 'first line' gen-rb/repro_types.rb
> # first line
> #
> # second line
> {noformat}
> Moving {{clean_up_doctext}} to {{parse/parse.cc}}, which both builds compile,
> lets the tests parse doc comments the way the compiler does and the assertion
> can state the real output.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)