Fix command-name substitution and rules move with duplicate at destination
ci / test (push) Waiting to run
ci / test (push) Waiting to run
This commit is contained in:
1 parent
6477fc66d2
commit
cb442e7d6f
4 files changed
+17
-4
No files matched your search
@@ -4110,6 +4110,17 @@ cli.main(["tick"])
|
||||
self.assertEqual(self.read(self.data, "rules", "user.md"), before)
|
||||
self.assertFalse(os.path.exists(os.path.join(self.proj, ".sisi")))
|
||||
|
||||
def test_rules_move_succeeds_when_the_destination_already_has_the_line(self):
|
||||
line = "- Duplicate destination rule stays once [owner 2026-11-20]"
|
||||
self.user_file(line + "\n- Another user rule [retro 2026-11-21]\n")
|
||||
other = self.project("other")
|
||||
os.makedirs(os.path.join(other, ".sisi"), exist_ok=True)
|
||||
proj_rules = self.write(os.path.join(other, ".sisi", "rules.md"), line + "\n")
|
||||
rc, out, _ = self.sisi("rules", "move", "Duplicate destination rule", "project", "--project", other)
|
||||
self.assertEqual(rc, 0, out)
|
||||
self.assertEqual(self.read(self.data, "rules", "user.md"), "- Another user rule [retro 2026-11-21]\n")
|
||||
self.assertEqual(self.read(proj_rules), line + "\n")
|
||||
|
||||
def test_move_prefers_the_exact_line_when_one_rule_is_a_prefix_of_another(self): # undo review A
|
||||
self.user_file("- Check logs\n")
|
||||
self.write(os.path.join(self.data, "rules", "core.md"), "- Check logs in CI\n")
|
||||
|
||||
Reference in new issue
Block a user