]> gitweb.factorcode.org Git - factor.git/blob - extra/ctags/etags/etags-tests.factor
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
[factor.git] / extra / ctags / etags / etags-tests.factor
1 USING: kernel ctags ctags.etags tools.test io.backend sequences arrays prettyprint hashtables assocs ;
2 IN: ctags.etags.tests
3
4 ! etag-at
5 { t }
6 [
7   V{ }
8   "path" H{ } clone etag-at =
9 ] unit-test
10
11 { t }
12 [
13   V{ if { "path" 1 } }
14   "path" H{ { "path" V{ if { "path" 1 } } } } etag-at =
15 ] unit-test
16
17 ! etag-vector
18 { t }
19 [
20   V{ }
21   { if { "path" 1 } } H{ } clone etag-vector =
22 ] unit-test
23
24 { t }
25 [
26   V{ if { "path" 1 } }
27   { if { "path" 1 } }
28   { { "path" V{ if { "path" 1 } } } } >hashtable
29   etag-vector =
30 ] unit-test
31
32 ! etag-pair 
33 { t }
34 [
35   { if 28 }
36   { if { "resource:core/kernel/kernel.factor" 28 } } etag-pair =
37 ] unit-test
38
39 ! etag-add
40 { t }
41 [
42   H{ { "path" V{ { if  1 } } } }
43   { if { "path" 1 } } H{ } clone [ etag-add ] keep =
44 ] unit-test
45
46 ! etag-hash
47 { t }
48 [
49   H{ { "path" V{ { if 1 } } } }
50   { { if { "path" 1 } } } etag-hash =
51 ] unit-test
52
53 ! line-bytes (note that for each line implicit \n is counted)
54 { t }
55 [
56   17
57   { "1234567890" "12345" } 2 lines>bytes =
58 ] unit-test
59
60 ! etag
61 { t }
62 [
63   "if\7f2,11"
64   { "1234567890" "12345" } { if 2 } etag =
65 ] unit-test