]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/tools/inspector/inspector-tests.factor
7127d5d01afa283ad438117f3805e5d87d2aadd0
[factor.git] / basis / ui / tools / inspector / inspector-tests.factor
1 USING: assocs formatting kernel math math.parser models
2 sequences strings tools.test ui.tools.inspector unicode ;
3
4 { } [ \ + <model> <inspector-gadget> com-edit-slot ] unit-test
5
6 ! Make sure we can click around in the inspector
7 { } [
8     "abcdefg" [
9         swap [ dup number>string ] dip dup
10         dup unicode:printable? [ 1string ] [
11             dup 0xff <= [
12                 H{
13                     { CHAR: \a "\\a" }
14                     { CHAR: \b "\\b" }
15                     { CHAR: \e "\\e" }
16                     { CHAR: \f "\\f" }
17                     { CHAR: \n "\\n" }
18                     { CHAR: \r "\\r" }
19                     { CHAR: \t "\\t" }
20                     { CHAR: \v "\\v" }
21                     { CHAR: \0 "\\0" }
22                 } ?at [ "\\x%02x" sprintf ] unless
23             ] [
24                 "\\u{%x}" sprintf
25             ] if
26         ] if slot-description boa
27     ] { } map-index-as drop
28 ] unit-test