]> gitweb.factorcode.org Git - factor.git/blob - extra/tnetstrings/tnetstrings-tests.factor
arm.64.factor: extra semicolon removed
[factor.git] / extra / tnetstrings / tnetstrings-tests.factor
1 ! Copyright (C) 2011 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
3
4 USING: kernel tnetstrings sequences tools.test ;
5
6 { t } [
7     {
8         { H{ } "0:}" }
9         { { } "0:]" }
10         { "" "0:\"" }
11         { t "4:true!" }
12         { f "5:false!" }
13         { 12345 "5:12345#" }
14         { "this is cool" "12:this is cool\"" }
15         {
16             H{ { "hello" { 12345678901 "this" } } }
17             "34:5:hello\"22:11:12345678901#4:this\"]}"
18         }
19         {
20             { 12345 67890 "xxxxx" }
21             "24:5:12345#5:67890#5:xxxxx\"]"
22         }
23     } [
24         first2 [ tnetstring> = ] [ swap >tnetstring = ] 2bi and
25     ] all?
26 ] unit-test