|
1 | 1 | library(testit) |
2 | 2 |
|
3 | | -1 %==% 1 |
4 | | - |
5 | | -assert( |
6 | | - 'next_nearest() works', |
7 | | - next_nearest(c(1, 4, 8), 1:9) %==% c(2L, 5L, 9L) |
8 | | -) |
9 | | - |
10 | | -assert( |
11 | | - 'with_ext() works', |
12 | | - with_ext(NULL, 'a') %==% NULL, |
13 | | - with_ext('a', NULL) %==% 'a', |
14 | | - with_ext('a', 'bcd') %==% 'a.bcd', |
15 | | - with_ext('a.html', '') %==% 'a', |
16 | | - with_ext('a.html', 'tex') %==% 'a.tex', |
17 | | - with_ext('a.html', '.tex') %==% 'a.tex', |
18 | | - with_ext(c('a', 'b', 'c'), 'css') %==% c('a.css', 'b.css', 'c.css'), |
19 | | - with_ext(c('a.html', 'b', 'c.js'), 'css') %==% c('a.css', 'b.css', 'c.css'), |
20 | | - with_ext(c('a.html', 'b', 'c'), '.css') %==% c('a.css', 'b.css', 'c.css'), |
21 | | - with_ext('a', c('css', '.html')) %==% c('a.css', 'a.html'), |
22 | | - with_ext(c('a.doc', 'b.gz', 'c'), c('css', '.tar', '.png')) %==% c('a.css', 'b.tar', 'c.png') |
23 | | -) |
24 | | - |
25 | | -assert( |
26 | | - 'with_ext() signals an error when length(x) != length(ext)', |
27 | | - has_error(with_ext(c('a', 'b.css'), c('foo', 'bar', 'ham'))) |
28 | | -) |
| 3 | +assert('next_nearest() works', { |
| 4 | + (next_nearest(c(1, 4, 8), 1:9) %==% c(2L, 5L, 9L)) |
| 5 | +}) |
29 | 6 |
|
30 | 7 | assert('clean_meta_tags() cleans HTML inside <meta>', { |
31 | 8 | (clean_meta_tags('<meta name="foo" content="hi text">') %==% |
|
0 commit comments