|
125 | 125 | (string:stripMargin " |hello |
126 | 126 | |abc") |
127 | 127 | "hello\nabc") |
128 | | - (test:eq |
129 | | - (string:stripMargin "hello |
130 | | - |abc |
131 | | - |d") |
132 | | - "hello\nabc\nd") |
133 | | - (test:eq |
134 | | - (string:stripMargin "hello |
135 | | - | |
136 | | - |abc |
137 | | - |d") |
138 | | - "hello\n\nabc\nd") }) |
| 128 | + (test:eq |
| 129 | + (string:stripMargin "hello |
| 130 | + |abc |
| 131 | + |d") |
| 132 | + "hello\nabc\nd") |
| 133 | + (test:eq |
| 134 | + (string:stripMargin "hello |
| 135 | + | |
| 136 | + |abc |
| 137 | + |d") |
| 138 | + "hello\n\nabc\nd") }) |
139 | 139 |
|
140 | 140 | (test:case "startsWith?" { |
141 | 141 | (test:expect (string:startsWith? "hello world" "hello")) |
|
145 | 145 | (test:expect (string:startsWith? "" "")) }) |
146 | 146 |
|
147 | 147 | (test:case "endsWith?" { |
148 | | - (test:expect (string:endsWith? "hello world" "world")) |
149 | | - (test:expect (not (string:endsWith? "hello world" "World"))) |
150 | | - (test:expect (not (string:endsWith? "hello world" "hello"))) |
151 | | - (test:expect (not (string:endsWith? "hello world" "worl"))) |
152 | | - (test:expect (string:endsWith? "" "")) }) |
| 148 | + (test:expect (string:endsWith? "hello world" "world")) |
| 149 | + (test:expect (not (string:endsWith? "hello world" "World"))) |
| 150 | + (test:expect (not (string:endsWith? "hello world" "hello"))) |
| 151 | + (test:expect (not (string:endsWith? "hello world" "worl"))) |
| 152 | + (test:expect (string:endsWith? "" "")) }) |
| 153 | + |
| 154 | + (test:case "lpad" { |
| 155 | + (test:eq (string:lpad "" 4 "1") "1111") |
| 156 | + (test:eq (string:lpad "2" 4 "1") "1112") |
| 157 | + (test:eq (string:lpad "22" 4 "1") "1122") |
| 158 | + (test:eq (string:lpad "222" 4 "1") "1222") |
| 159 | + (test:eq (string:lpad "2222" 4 "1") "2222") |
| 160 | + (test:eq (string:lpad "22222" 4 "1") "22222") }) |
| 161 | + |
| 162 | + (test:case "rpad" { |
| 163 | + (test:eq (string:rpad "" 4 "1") "1111") |
| 164 | + (test:eq (string:rpad "2" 4 "1") "2111") |
| 165 | + (test:eq (string:rpad "22" 4 "1") "2211") |
| 166 | + (test:eq (string:rpad "222" 4 "1") "2221") |
| 167 | + (test:eq (string:rpad "2222" 4 "1") "2222") |
| 168 | + (test:eq (string:rpad "22222" 4 "1") "22222") }) |
153 | 169 |
|
154 | 170 | (test:case "zfill" { |
155 | 171 | (test:eq (string:zfill "" 4) "0000") |
|
0 commit comments