Port the practice pager test behind recording widget doubles, wire the new behaviour tests into the Makefile and delete the C tests they replace. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
16 lines
520 B
Ziran
16 lines
520 B
Ziran
// Test double for the Kryon button widget: records the props it is given and
|
|
// reports a click when the button's id matches the requested one.
|
|
#import "button_props"
|
|
#import "session"
|
|
|
|
fake_button_count: s32;
|
|
fake_button_click: s32;
|
|
fake_buttons: [2]ButtonProps;
|
|
|
|
Button :: (session: Session, props: ButtonProps) -> s32 {
|
|
if fake_button_count < 2 { fake_buttons[fake_button_count] = props }
|
|
fake_button_count += 1
|
|
if props.disabled { return 0 }
|
|
return ifx props.id == fake_button_click then 1 else 0
|
|
}
|