Skip to content

Add trailing newlines to Rule data in output tests - #16

Merged
hzhangxyz merged 2 commits into
mainfrom
copilot/fix-rule-endline-in-tests
Dec 22, 2025
Merged

Add trailing newlines to Rule data in output tests#16
hzhangxyz merged 2 commits into
mainfrom
copilot/fix-rule-endline-in-tests

Conversation

Copilot AI commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

Rule data in output tests was missing trailing newlines, inconsistent with programmatically-generated rules throughout the codebase.

Changes

  • Updated all Rule test data in tests/test_output.py to include trailing \n
    • "a\n----\nb""a\n----\nb\n" (Facts)
    • "x\n----\ny""x\n----\ny\n" (Ideas)

Context

All rule-building functions in ddss/utility.py (term_build_rule, equality_build_rule, rule_get_idea) generate rules ending with \n:

def term_build_rule(data: str) -> str:
    return f"----\n{data}\n"  # Trailing newline

def rule_get_idea(data):
    if not data.startswith("--"):
        return f"----\n{data.splitlines()[0]}\n"  # Trailing newline

Test data now follows the same convention.

Original prompt

This section details on the original issue you should resolve

<issue_title>output的tests中,Rule的末尾应该有一个回车,这是为了保持一致性。</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing newline at the end of Rule in tests Add trailing newlines to Rule data in output tests Dec 22, 2025
Copilot AI requested a review from hzhangxyz December 22, 2025 16:09
@hzhangxyz
hzhangxyz marked this pull request as ready for review December 22, 2025 16:10
Copilot AI review requested due to automatic review settings December 22, 2025 16:10
@hzhangxyz
hzhangxyz merged commit 95942b2 into main Dec 22, 2025
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds trailing newlines to Rule test data in tests/test_output.py to align with the format used by rule-building functions throughout the codebase.

  • Updated all Rule test data strings to include trailing \n characters
  • Changed both Facts and Ideas test data entries from format "a\n----\nb" to "a\n----\nb\n"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

output的tests中,Rule的末尾应该有一个回车,这是为了保持一致性。

3 participants