Skip to content

Commit 86a3951

Browse files
author
Frankie Robertson
committed
Add test_ability to TestExt
1 parent d82fb65 commit 86a3951

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ext/TestExt.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,24 @@ function test_stateful_cat_item_bank_1d_dich_ib(
110110
end
111111
end
112112

113+
function test_ability(
114+
cat1::Stateful.StatefulCat,
115+
cat2::Stateful.StatefulCat,
116+
item_bank_length;
117+
margin=0.01
118+
)
119+
if item_bank_length < 4
120+
error("Item bank length must be at least 4.")
121+
end
122+
for cat in (cat1, cat2)
123+
Stateful.add_response!(cat, 1, false)
124+
Stateful.add_response!(cat, 2, true)
125+
Stateful.add_response!(cat, 3, false)
126+
Stateful.add_response!(cat, 4, true)
127+
end
128+
ability1 = Stateful.get_ability(cat1)
129+
ability2 = Stateful.get_ability(cat2)
130+
@test ability1[1] ability2[1] rtol=margin
131+
end
132+
113133
end

0 commit comments

Comments
 (0)