@@ -6,7 +6,7 @@ local output_window = require('opencode.ui.output_window')
66local function assert_output_matches (expected , actual )
77 local normalized_extmarks = helpers .normalize_namespace_ids (actual .extmarks )
88
9- assert .equal (
9+ assert .are . equal (
1010 # expected .lines ,
1111 # actual .lines ,
1212 string.format (
@@ -20,7 +20,7 @@ local function assert_output_matches(expected, actual)
2020 )
2121
2222 for i = 1 , # expected .lines do
23- assert .equal (
23+ assert .are . equal (
2424 expected .lines [i ],
2525 actual .lines [i ],
2626 string.format (
@@ -32,7 +32,7 @@ local function assert_output_matches(expected, actual)
3232 )
3333 end
3434
35- assert .equal (
35+ assert .are . equal (
3636 # expected .extmarks ,
3737 # normalized_extmarks ,
3838 string.format (
@@ -46,7 +46,7 @@ local function assert_output_matches(expected, actual)
4646 )
4747
4848 for i = 1 , # expected .extmarks do
49- assert .same (
49+ assert .are . same (
5050 expected .extmarks [i ],
5151 normalized_extmarks [i ],
5252 string.format (
@@ -57,6 +57,30 @@ local function assert_output_matches(expected, actual)
5757 )
5858 )
5959 end
60+
61+ local expected_action_count = expected .actions and # expected .actions or 0
62+ local actual_action_count = actual .actions and # actual .actions or 0
63+
64+ assert .are .equal (
65+ expected_action_count ,
66+ actual_action_count ,
67+ string.format (' Action count mismatch: expected %d, got %d' , expected_action_count , actual_action_count )
68+ )
69+
70+ if expected .actions then
71+ for i = 1 , # expected .actions do
72+ assert .are .same (
73+ expected .actions [i ],
74+ actual .actions [i ],
75+ string.format (
76+ ' Action %d mismatch:\n Expected: %s\n Actual: %s' ,
77+ i ,
78+ vim .inspect (expected .actions [i ]),
79+ vim .inspect (actual .actions [i ])
80+ )
81+ )
82+ end
83+ end
6084end
6185
6286describe (' renderer' , function ()
0 commit comments