@@ -336,6 +336,37 @@ def test_strips_rst_bold_markup_from_body(self):
336336 self .assertNotIn ("**" , result [0 ]["body" ])
337337 self .assertIn ("robust" , result [0 ]["body" ])
338338
339+ def test_multi_line_title_is_joined_and_fields_still_parsed (self ):
340+ """docutils allows a directive's argument to wrap onto continuation
341+ lines with no blank-line separator; the real field list must still
342+ be found on the lines that follow."""
343+ rst = _rst (
344+ ".. comp_req:: Logging During the C++ Static Storage" ,
345+ " construction and destruction." ,
346+ " :id: comp_req__test__001" ,
347+ " :safety: QM" ,
348+ "" ,
349+ " Body." ,
350+ )
351+ result = parse_directives (rst )
352+ self .assertEqual (len (result ), 1 )
353+ self .assertEqual (
354+ result [0 ]["title" ],
355+ "Logging During the C++ Static Storage construction and destruction." ,
356+ )
357+ self .assertEqual (result [0 ]["fields" ]["id" ], "comp_req__test__001" )
358+
359+ def test_single_line_title_unaffected_by_continuation_handling (self ):
360+ rst = _rst (
361+ ".. feat_req:: Single Line Title" ,
362+ " :id: feat_req__test__001" ,
363+ " :safety: QM" ,
364+ "" ,
365+ " Body." ,
366+ )
367+ result = parse_directives (rst )
368+ self .assertEqual (result [0 ]["title" ], "Single Line Title" )
369+
339370
340371# ---------------------------------------------------------------------------
341372# render_trlc – TRLC output for each S-CORE type
@@ -545,6 +576,25 @@ def test_mitigates_is_not_a_ref_field(self):
545576 def test_returns_empty_when_no_ref_fields (self ):
546577 self .assertEqual (_collect_refs ({"safety" : "QM" , "reqtype" : "Functional" }), [])
547578
579+ def test_strips_trailing_needs_filter (self ):
580+ """sphinx-needs filter suffixes are not valid TRLC reference syntax."""
581+ self .assertEqual (
582+ _collect_refs ({"satisfies" : "req_001[version==1]" }),
583+ ["req_001" ],
584+ )
585+
586+ def test_strips_multiple_trailing_needs_filters (self ):
587+ self .assertEqual (
588+ _collect_refs ({"satisfies" : "req_001[version==1][status==valid]" }),
589+ ["req_001" ],
590+ )
591+
592+ def test_strips_needs_filter_from_each_comma_separated_ref (self ):
593+ self .assertEqual (
594+ _collect_refs ({"satisfies" : "req_001[version==1], req_002[status==valid]" }),
595+ ["req_001" , "req_002" ],
596+ )
597+
548598
549599# ---------------------------------------------------------------------------
550600# _collect_body – blank-line handling consistency
0 commit comments