]> gitweb.factorcode.org Git - factor.git/blob - basis/wrap/strings/strings-tests.factor
Fixing unit tests for stack effect inference changes
[factor.git] / basis / wrap / strings / strings-tests.factor
1 ! Copyright (C) 2008, 2009 Daniel Ehrenberg, Slava Pestov
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: wrap.strings tools.test multiline ;
4 IN: wrap.strings.tests
5
6 [
7     <" This is a
8 long piece
9 of text
10 that we
11 wish to
12 word wrap.">
13 ] [
14     <" This is a long piece of text that we wish to word wrap."> 10
15     wrap-string
16 ] unit-test
17     
18 [
19     <"   This is a
20   long piece
21   of text
22   that we
23   wish to
24   word wrap.">
25 ] [
26     <" This is a long piece of text that we wish to word wrap."> 12
27     "  " wrap-indented-string
28 ] unit-test
29
30 [ "this text\nhas lots of\nspaces" ]
31 [ "this text        has lots of       spaces" 12 wrap-string ] unit-test
32
33 [ "hello\nhow\nare\nyou\ntoday?" ]
34 [ "hello how are you today?" 3 wrap-string ] unit-test
35
36 [ "aaa\nbb cc\nddddd" ] [ "aaa bb cc ddddd" 6 wrap-string ] unit-test
37 [ "aaa\nbb ccc\ndddddd" ] [ "aaa bb ccc dddddd" 6 wrap-string ] unit-test
38 [ "aaa bb\ncccc\nddddd" ] [ "aaa bb cccc ddddd" 6 wrap-string ] unit-test
39 [ "aaa bb\nccccccc\nddddddd" ] [ "aaa bb ccccccc ddddddd" 6 wrap-string ] unit-test
40
41 [ "a b c d e f\ng h" ] [ "a b c d e f g h" 11 wrap-string ] unit-test