factor/extra/classes/tuple/change-tracking/change-tracking-tests.factor

11 lines
368 B
Factor
Raw Normal View History

USING: classes.tuple.change-tracking tools.test ;
IN: classes.tuple.change-tracking.tests
TUPLE: resource < change-tracking-tuple
{ pathname string } ;
: <resource> ( pathname -- resource ) f swap resource boa ;
[ t ] [ "foo" <resource> "bar" >>pathname changed?>> ] unit-test
[ f ] [ "foo" <resource> [ 123 >>pathname ] [ drop ] recover changed?>> ] unit-test