livetext 0.9.09 → 0.9.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/bin/livetext +0 -1
  3. data/lib/errors.rb +15 -0
  4. data/lib/formatline.rb +3 -5
  5. data/lib/functions.rb +6 -2
  6. data/lib/helpers.rb +25 -0
  7. data/lib/html.rb +32 -0
  8. data/lib/livetext/importable.rb +2 -0
  9. data/lib/livetext.rb +60 -48
  10. data/lib/parser/general.rb +38 -0
  11. data/lib/parser/import.rb +17 -0
  12. data/lib/parser/mixin.rb +40 -0
  13. data/lib/parser/set.rb +136 -0
  14. data/lib/parser/string.rb +55 -0
  15. data/lib/parser.rb +5 -0
  16. data/lib/processor.rb +22 -23
  17. data/lib/standard.rb +145 -298
  18. data/lib/userapi.rb +2 -5
  19. data/livetext.gemspec +1 -2
  20. data/test/all.rb +4 -0
  21. data/test/formatting-tests.rb +35 -0
  22. data/test/formatting.rb +2 -9
  23. data/test/snapshots/OMIT.txt +10 -0
  24. data/test/{data → snapshots}/basic_formatting/expected-error.txt +0 -0
  25. data/test/{data → snapshots}/basic_formatting/expected-output.txt +0 -0
  26. data/test/{data → snapshots}/basic_formatting/source.lt3 +0 -0
  27. data/test/{data → snapshots}/block_comment/expected-error.txt +0 -0
  28. data/test/{data → snapshots}/block_comment/expected-output.txt +0 -0
  29. data/test/{data → snapshots}/block_comment/source.lt3 +0 -0
  30. data/test/{data → snapshots}/comments_ignored_1/expected-error.txt +0 -0
  31. data/test/{data → snapshots}/comments_ignored_1/expected-output.txt +0 -0
  32. data/test/{data → snapshots}/comments_ignored_1/source.lt3 +0 -0
  33. data/test/{data → snapshots}/copy_is_raw/expected-error.txt +0 -0
  34. data/test/{data → snapshots}/copy_is_raw/expected-output.txt +0 -0
  35. data/test/{data → snapshots}/copy_is_raw/rawtext.inc +0 -0
  36. data/test/{data → snapshots}/copy_is_raw/source.lt3 +0 -0
  37. data/test/{data → snapshots}/crap +0 -0
  38. data/test/{data → snapshots}/def_method/expected-error.txt +0 -0
  39. data/test/{data → snapshots}/def_method/expected-output.txt +0 -0
  40. data/test/{data → snapshots}/def_method/source.lt3 +0 -0
  41. data/test/{data → snapshots}/error_inc_line_num/expected-output.txt +6 -0
  42. data/test/{data → snapshots}/error_inc_line_num/file2.lt3 +0 -0
  43. data/test/snapshots/error_inc_line_num/match-error.txt +1 -0
  44. data/test/{data → snapshots}/error_inc_line_num/source.lt3 +0 -0
  45. data/test/{data → snapshots}/error_invalid_name/expected-output.txt +0 -0
  46. data/test/snapshots/error_invalid_name/match-error.txt +1 -0
  47. data/test/{data → snapshots}/error_invalid_name/source.lt3 +0 -0
  48. data/test/{data → snapshots}/error_line_num/expected-output.txt +0 -0
  49. data/test/snapshots/error_line_num/match-error.txt +1 -0
  50. data/test/{data → snapshots}/error_line_num/source.lt3 +0 -0
  51. data/test/{data → snapshots}/error_mismatched_end/expected-output.txt +0 -0
  52. data/test/snapshots/error_mismatched_end/match-error.txt +1 -0
  53. data/test/{data → snapshots}/error_mismatched_end/source.lt3 +0 -0
  54. data/test/{data → snapshots}/error_missing_end/expected-output.txt +1 -0
  55. data/test/snapshots/error_missing_end/match-error.txt +1 -0
  56. data/test/{data → snapshots}/error_missing_end/source.lt3 +0 -0
  57. data/test/{data/error_no_such_mixin → snapshots/error_name_not_permitted}/expected-output.txt +0 -0
  58. data/test/snapshots/error_name_not_permitted/match-error.txt +1 -0
  59. data/test/{data → snapshots}/error_name_not_permitted/source.lt3 +0 -0
  60. data/test/{data → snapshots}/error_no_such_copy/expected-output.txt +0 -1
  61. data/test/snapshots/error_no_such_copy/match-error.txt +1 -0
  62. data/test/{data → snapshots}/error_no_such_copy/source.lt3 +1 -0
  63. data/test/{data → snapshots}/error_no_such_inc/expected-output.txt +0 -0
  64. data/test/snapshots/error_no_such_inc/match-error.txt +1 -0
  65. data/test/{data → snapshots}/error_no_such_inc/source.lt3 +0 -0
  66. data/test/snapshots/error_no_such_mixin/expected-output.txt +5 -0
  67. data/test/snapshots/error_no_such_mixin/match-error.txt +1 -0
  68. data/test/{data → snapshots}/error_no_such_mixin/source.lt3 +0 -0
  69. data/test/{data → snapshots}/example_alpha/expected-error.txt +0 -0
  70. data/test/{data → snapshots}/example_alpha/expected-output.txt +0 -0
  71. data/test/{data → snapshots}/example_alpha/source.lt3 +0 -0
  72. data/test/{data → snapshots}/example_alpha2/expected-error.txt +0 -0
  73. data/test/{data → snapshots}/example_alpha2/expected-output.txt +0 -0
  74. data/test/{data → snapshots}/example_alpha2/source.lt3 +0 -0
  75. data/test/{data → snapshots}/fixit +0 -0
  76. data/test/{data/lines.txt → snapshots/formatting-tests.txt} +4 -0
  77. data/test/{data → snapshots}/functions/expected-error.txt +0 -0
  78. data/test/{data → snapshots}/functions/expected-output.txt +0 -0
  79. data/test/{data → snapshots}/functions/source.lt3 +0 -0
  80. data/test/{data → snapshots}/hello_world/expected-error.txt +0 -0
  81. data/test/{data → snapshots}/hello_world/expected-output.txt +0 -0
  82. data/test/{data → snapshots}/hello_world/source.lt3 +0 -0
  83. data/test/{data → snapshots}/more_complex_vars/expected-error.txt +0 -0
  84. data/test/{data → snapshots}/more_complex_vars/expected-output.txt +0 -0
  85. data/test/{data → snapshots}/more_complex_vars/source.lt3 +0 -0
  86. data/test/{data/raw_lines → snapshots/predef_vars}/expected-error.txt +0 -0
  87. data/test/snapshots/predef_vars/match-output.txt +6 -0
  88. data/test/snapshots/predef_vars/source.lt3 +6 -0
  89. data/test/{data/raw_text_block → snapshots/raw_lines}/expected-error.txt +0 -0
  90. data/test/{data → snapshots}/raw_lines/expected-output.txt +0 -0
  91. data/test/{data → snapshots}/raw_lines/source.lt3 +0 -0
  92. data/test/{data/simple_copy → snapshots/raw_text_block}/expected-error.txt +0 -0
  93. data/test/{data → snapshots}/raw_text_block/expected-output.txt +0 -0
  94. data/test/{data → snapshots}/raw_text_block/rawtext.inc +0 -0
  95. data/test/{data → snapshots}/raw_text_block/source.lt3 +0 -0
  96. data/test/{data/simple_include → snapshots/simple_copy}/expected-error.txt +0 -0
  97. data/test/{data → snapshots}/simple_copy/expected-output.txt +0 -0
  98. data/test/{data → snapshots}/simple_copy/simplefile.inc +0 -0
  99. data/test/{data → snapshots}/simple_copy/source.lt3 +0 -0
  100. data/test/{data/simple_mixin → snapshots/simple_include}/expected-error.txt +0 -0
  101. data/test/{data → snapshots}/simple_include/expected-output.txt +0 -0
  102. data/test/{data → snapshots}/simple_include/simplefile.inc +0 -0
  103. data/test/{data → snapshots}/simple_include/source.lt3 +0 -0
  104. data/test/{data/simple_vars → snapshots/simple_mixin}/expected-error.txt +0 -0
  105. data/test/{data → snapshots}/simple_mixin/expected-output.txt +0 -0
  106. data/test/{data → snapshots}/simple_mixin/simple_mixin.rb +0 -0
  107. data/test/{data → snapshots}/simple_mixin/source.lt3 +0 -0
  108. data/test/{data/single_raw_line → snapshots/simple_vars}/expected-error.txt +0 -0
  109. data/test/{data → snapshots}/simple_vars/expected-output.txt +0 -0
  110. data/test/{data → snapshots}/simple_vars/source.lt3 +0 -0
  111. data/test/{data/table_with_heredocs → snapshots/single_raw_line}/expected-error.txt +0 -0
  112. data/test/{data → snapshots}/single_raw_line/expected-output.txt +0 -0
  113. data/test/{data → snapshots}/single_raw_line/source.lt3 +0 -0
  114. data/test/{data → snapshots}/subset.txt +0 -0
  115. data/test/snapshots/table_with_heredocs/expected-error.txt +0 -0
  116. data/test/{data → snapshots}/table_with_heredocs/expected-output.txt +0 -0
  117. data/test/{data → snapshots}/table_with_heredocs/source.lt3 +0 -0
  118. data/test/snapshots.rb +168 -0
  119. data/test/testlines.rb +17 -7
  120. data/test/unit/all.rb +3 -0
  121. data/test/unit/html.rb +38 -0
  122. data/test/unit/parser/all.rb +3 -0
  123. data/test/unit/parser/general.rb +59 -0
  124. data/test/unit/parser/importable.rb +19 -0
  125. data/test/unit/parser/mixin.rb +19 -0
  126. data/test/unit/parser/set.rb +157 -0
  127. data/test/unit/parser/string.rb +130 -0
  128. data/test/unit/parser.rb +6 -0
  129. data/test/unit/standard.rb +23 -0
  130. data/test/unit/stringparser.rb +140 -0
  131. metadata +122 -96
  132. data/test/data/error_inc_line_num/expected-err-line1match.txt +0 -1
  133. data/test/data/error_invalid_name/expected-err-line1match.txt +0 -1
  134. data/test/data/error_line_num/expected-err-line1match.txt +0 -1
  135. data/test/data/error_mismatched_end/expected-err-line1match.txt +0 -1
  136. data/test/data/error_missing_end/expected-err-line1match.txt +0 -1
  137. data/test/data/error_name_not_permitted/expected-error.txt +0 -1
  138. data/test/data/error_name_not_permitted/expected-output.txt +0 -4
  139. data/test/data/error_no_such_copy/expected-err-line1match.txt +0 -1
  140. data/test/data/error_no_such_inc/expected-err-line1match.txt +0 -1
  141. data/test/data/error_no_such_mixin/expected-err-line1match.txt +0 -1
  142. data/test/extratests.txt +0 -20
  143. data/test/test.rb +0 -140
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livetext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.09
4
+ version: 0.9.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-07 00:00:00.000000000 Z
11
+ date: 2021-12-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com
@@ -20,9 +20,19 @@ files:
20
20
  - "./README.lt3"
21
21
  - "./README.md"
22
22
  - bin/livetext
23
+ - lib/errors.rb
23
24
  - lib/formatline.rb
24
25
  - lib/functions.rb
26
+ - lib/helpers.rb
27
+ - lib/html.rb
25
28
  - lib/livetext.rb
29
+ - lib/livetext/importable.rb
30
+ - lib/parser.rb
31
+ - lib/parser/general.rb
32
+ - lib/parser/import.rb
33
+ - lib/parser/mixin.rb
34
+ - lib/parser/set.rb
35
+ - lib/parser/string.rb
26
36
  - lib/processor.rb
27
37
  - lib/standard.rb
28
38
  - lib/userapi.rb
@@ -35,104 +45,120 @@ files:
35
45
  - plugin/tutorial.rb
36
46
  - test/affirm/kbks.jpg
37
47
  - test/affirm/lm-kbks.lt
48
+ - test/all.rb
38
49
  - test/cleanup
39
- - test/data/basic_formatting/expected-error.txt
40
- - test/data/basic_formatting/expected-output.txt
41
- - test/data/basic_formatting/source.lt3
42
- - test/data/block_comment/expected-error.txt
43
- - test/data/block_comment/expected-output.txt
44
- - test/data/block_comment/source.lt3
45
- - test/data/comments_ignored_1/expected-error.txt
46
- - test/data/comments_ignored_1/expected-output.txt
47
- - test/data/comments_ignored_1/source.lt3
48
- - test/data/copy_is_raw/expected-error.txt
49
- - test/data/copy_is_raw/expected-output.txt
50
- - test/data/copy_is_raw/rawtext.inc
51
- - test/data/copy_is_raw/source.lt3
52
- - test/data/crap
53
- - test/data/def_method/expected-error.txt
54
- - test/data/def_method/expected-output.txt
55
- - test/data/def_method/source.lt3
56
- - test/data/error_inc_line_num/expected-err-line1match.txt
57
- - test/data/error_inc_line_num/expected-output.txt
58
- - test/data/error_inc_line_num/file2.lt3
59
- - test/data/error_inc_line_num/source.lt3
60
- - test/data/error_invalid_name/expected-err-line1match.txt
61
- - test/data/error_invalid_name/expected-output.txt
62
- - test/data/error_invalid_name/source.lt3
63
- - test/data/error_line_num/expected-err-line1match.txt
64
- - test/data/error_line_num/expected-output.txt
65
- - test/data/error_line_num/source.lt3
66
- - test/data/error_mismatched_end/expected-err-line1match.txt
67
- - test/data/error_mismatched_end/expected-output.txt
68
- - test/data/error_mismatched_end/source.lt3
69
- - test/data/error_missing_end/expected-err-line1match.txt
70
- - test/data/error_missing_end/expected-output.txt
71
- - test/data/error_missing_end/source.lt3
72
- - test/data/error_name_not_permitted/expected-error.txt
73
- - test/data/error_name_not_permitted/expected-output.txt
74
- - test/data/error_name_not_permitted/source.lt3
75
- - test/data/error_no_such_copy/expected-err-line1match.txt
76
- - test/data/error_no_such_copy/expected-output.txt
77
- - test/data/error_no_such_copy/source.lt3
78
- - test/data/error_no_such_inc/expected-err-line1match.txt
79
- - test/data/error_no_such_inc/expected-output.txt
80
- - test/data/error_no_such_inc/source.lt3
81
- - test/data/error_no_such_mixin/expected-err-line1match.txt
82
- - test/data/error_no_such_mixin/expected-output.txt
83
- - test/data/error_no_such_mixin/source.lt3
84
- - test/data/example_alpha/expected-error.txt
85
- - test/data/example_alpha/expected-output.txt
86
- - test/data/example_alpha/source.lt3
87
- - test/data/example_alpha2/expected-error.txt
88
- - test/data/example_alpha2/expected-output.txt
89
- - test/data/example_alpha2/source.lt3
90
- - test/data/fixit
91
- - test/data/functions/expected-error.txt
92
- - test/data/functions/expected-output.txt
93
- - test/data/functions/source.lt3
94
- - test/data/hello_world/expected-error.txt
95
- - test/data/hello_world/expected-output.txt
96
- - test/data/hello_world/source.lt3
97
- - test/data/lines.txt
98
- - test/data/more_complex_vars/expected-error.txt
99
- - test/data/more_complex_vars/expected-output.txt
100
- - test/data/more_complex_vars/source.lt3
101
- - test/data/raw_lines/expected-error.txt
102
- - test/data/raw_lines/expected-output.txt
103
- - test/data/raw_lines/source.lt3
104
- - test/data/raw_text_block/expected-error.txt
105
- - test/data/raw_text_block/expected-output.txt
106
- - test/data/raw_text_block/rawtext.inc
107
- - test/data/raw_text_block/source.lt3
108
- - test/data/simple_copy/expected-error.txt
109
- - test/data/simple_copy/expected-output.txt
110
- - test/data/simple_copy/simplefile.inc
111
- - test/data/simple_copy/source.lt3
112
- - test/data/simple_include/expected-error.txt
113
- - test/data/simple_include/expected-output.txt
114
- - test/data/simple_include/simplefile.inc
115
- - test/data/simple_include/source.lt3
116
- - test/data/simple_mixin/expected-error.txt
117
- - test/data/simple_mixin/expected-output.txt
118
- - test/data/simple_mixin/simple_mixin.rb
119
- - test/data/simple_mixin/source.lt3
120
- - test/data/simple_vars/expected-error.txt
121
- - test/data/simple_vars/expected-output.txt
122
- - test/data/simple_vars/source.lt3
123
- - test/data/single_raw_line/expected-error.txt
124
- - test/data/single_raw_line/expected-output.txt
125
- - test/data/single_raw_line/source.lt3
126
- - test/data/subset.txt
127
- - test/data/table_with_heredocs/expected-error.txt
128
- - test/data/table_with_heredocs/expected-output.txt
129
- - test/data/table_with_heredocs/source.lt3
130
- - test/extratests.txt
50
+ - test/formatting-tests.rb
131
51
  - test/formatting.rb
132
52
  - test/newtest
133
53
  - test/sdtest
134
- - test/test.rb
54
+ - test/snapshots.rb
55
+ - test/snapshots/OMIT.txt
56
+ - test/snapshots/basic_formatting/expected-error.txt
57
+ - test/snapshots/basic_formatting/expected-output.txt
58
+ - test/snapshots/basic_formatting/source.lt3
59
+ - test/snapshots/block_comment/expected-error.txt
60
+ - test/snapshots/block_comment/expected-output.txt
61
+ - test/snapshots/block_comment/source.lt3
62
+ - test/snapshots/comments_ignored_1/expected-error.txt
63
+ - test/snapshots/comments_ignored_1/expected-output.txt
64
+ - test/snapshots/comments_ignored_1/source.lt3
65
+ - test/snapshots/copy_is_raw/expected-error.txt
66
+ - test/snapshots/copy_is_raw/expected-output.txt
67
+ - test/snapshots/copy_is_raw/rawtext.inc
68
+ - test/snapshots/copy_is_raw/source.lt3
69
+ - test/snapshots/crap
70
+ - test/snapshots/def_method/expected-error.txt
71
+ - test/snapshots/def_method/expected-output.txt
72
+ - test/snapshots/def_method/source.lt3
73
+ - test/snapshots/error_inc_line_num/expected-output.txt
74
+ - test/snapshots/error_inc_line_num/file2.lt3
75
+ - test/snapshots/error_inc_line_num/match-error.txt
76
+ - test/snapshots/error_inc_line_num/source.lt3
77
+ - test/snapshots/error_invalid_name/expected-output.txt
78
+ - test/snapshots/error_invalid_name/match-error.txt
79
+ - test/snapshots/error_invalid_name/source.lt3
80
+ - test/snapshots/error_line_num/expected-output.txt
81
+ - test/snapshots/error_line_num/match-error.txt
82
+ - test/snapshots/error_line_num/source.lt3
83
+ - test/snapshots/error_mismatched_end/expected-output.txt
84
+ - test/snapshots/error_mismatched_end/match-error.txt
85
+ - test/snapshots/error_mismatched_end/source.lt3
86
+ - test/snapshots/error_missing_end/expected-output.txt
87
+ - test/snapshots/error_missing_end/match-error.txt
88
+ - test/snapshots/error_missing_end/source.lt3
89
+ - test/snapshots/error_name_not_permitted/expected-output.txt
90
+ - test/snapshots/error_name_not_permitted/match-error.txt
91
+ - test/snapshots/error_name_not_permitted/source.lt3
92
+ - test/snapshots/error_no_such_copy/expected-output.txt
93
+ - test/snapshots/error_no_such_copy/match-error.txt
94
+ - test/snapshots/error_no_such_copy/source.lt3
95
+ - test/snapshots/error_no_such_inc/expected-output.txt
96
+ - test/snapshots/error_no_such_inc/match-error.txt
97
+ - test/snapshots/error_no_such_inc/source.lt3
98
+ - test/snapshots/error_no_such_mixin/expected-output.txt
99
+ - test/snapshots/error_no_such_mixin/match-error.txt
100
+ - test/snapshots/error_no_such_mixin/source.lt3
101
+ - test/snapshots/example_alpha/expected-error.txt
102
+ - test/snapshots/example_alpha/expected-output.txt
103
+ - test/snapshots/example_alpha/source.lt3
104
+ - test/snapshots/example_alpha2/expected-error.txt
105
+ - test/snapshots/example_alpha2/expected-output.txt
106
+ - test/snapshots/example_alpha2/source.lt3
107
+ - test/snapshots/fixit
108
+ - test/snapshots/formatting-tests.txt
109
+ - test/snapshots/functions/expected-error.txt
110
+ - test/snapshots/functions/expected-output.txt
111
+ - test/snapshots/functions/source.lt3
112
+ - test/snapshots/hello_world/expected-error.txt
113
+ - test/snapshots/hello_world/expected-output.txt
114
+ - test/snapshots/hello_world/source.lt3
115
+ - test/snapshots/more_complex_vars/expected-error.txt
116
+ - test/snapshots/more_complex_vars/expected-output.txt
117
+ - test/snapshots/more_complex_vars/source.lt3
118
+ - test/snapshots/predef_vars/expected-error.txt
119
+ - test/snapshots/predef_vars/match-output.txt
120
+ - test/snapshots/predef_vars/source.lt3
121
+ - test/snapshots/raw_lines/expected-error.txt
122
+ - test/snapshots/raw_lines/expected-output.txt
123
+ - test/snapshots/raw_lines/source.lt3
124
+ - test/snapshots/raw_text_block/expected-error.txt
125
+ - test/snapshots/raw_text_block/expected-output.txt
126
+ - test/snapshots/raw_text_block/rawtext.inc
127
+ - test/snapshots/raw_text_block/source.lt3
128
+ - test/snapshots/simple_copy/expected-error.txt
129
+ - test/snapshots/simple_copy/expected-output.txt
130
+ - test/snapshots/simple_copy/simplefile.inc
131
+ - test/snapshots/simple_copy/source.lt3
132
+ - test/snapshots/simple_include/expected-error.txt
133
+ - test/snapshots/simple_include/expected-output.txt
134
+ - test/snapshots/simple_include/simplefile.inc
135
+ - test/snapshots/simple_include/source.lt3
136
+ - test/snapshots/simple_mixin/expected-error.txt
137
+ - test/snapshots/simple_mixin/expected-output.txt
138
+ - test/snapshots/simple_mixin/simple_mixin.rb
139
+ - test/snapshots/simple_mixin/source.lt3
140
+ - test/snapshots/simple_vars/expected-error.txt
141
+ - test/snapshots/simple_vars/expected-output.txt
142
+ - test/snapshots/simple_vars/source.lt3
143
+ - test/snapshots/single_raw_line/expected-error.txt
144
+ - test/snapshots/single_raw_line/expected-output.txt
145
+ - test/snapshots/single_raw_line/source.lt3
146
+ - test/snapshots/subset.txt
147
+ - test/snapshots/table_with_heredocs/expected-error.txt
148
+ - test/snapshots/table_with_heredocs/expected-output.txt
149
+ - test/snapshots/table_with_heredocs/source.lt3
135
150
  - test/testlines.rb
151
+ - test/unit/all.rb
152
+ - test/unit/html.rb
153
+ - test/unit/parser.rb
154
+ - test/unit/parser/all.rb
155
+ - test/unit/parser/general.rb
156
+ - test/unit/parser/importable.rb
157
+ - test/unit/parser/mixin.rb
158
+ - test/unit/parser/set.rb
159
+ - test/unit/parser/string.rb
160
+ - test/unit/standard.rb
161
+ - test/unit/stringparser.rb
136
162
  homepage: https://github.com/Hal9000/livetext
137
163
  licenses:
138
164
  - Ruby
@@ -152,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
178
  - !ruby/object:Gem::Version
153
179
  version: '0'
154
180
  requirements: []
155
- rubygems_version: 3.0.8
181
+ rubygems_version: 3.1.2
156
182
  signing_key:
157
183
  specification_version: 4
158
184
  summary: A smart processor for text
@@ -1 +0,0 @@
1
- Error: Name 'foobar' is unknown
@@ -1 +0,0 @@
1
- Error: Illegal name 'to_s'
@@ -1 +0,0 @@
1
- Error: Name 'foobar' is unknown
@@ -1 +0,0 @@
1
- Error: Mismatched 'end'
@@ -1 +0,0 @@
1
- Error: #<RuntimeError: Expected .end, found end of file>
@@ -1 +0,0 @@
1
- Error: Name 'class' is not permitted
@@ -1,4 +0,0 @@
1
- Names such as 'class'
2
- are not permitted here...
3
- <p>
4
-
@@ -1 +0,0 @@
1
- Error: No such file 'nosuchfile.txt' to copy
@@ -1 +0,0 @@
1
- Error: No such include file 'nosuchinc.lt3'
@@ -1 +0,0 @@
1
- No such mixin 'nosuchthing'
data/test/extratests.txt DELETED
@@ -1,20 +0,0 @@
1
- Line starts with underscore
2
- _This for example
3
- <i>This</i> for example
4
-
5
- Line starts with double underscore
6
- __This, for example
7
- <i>This,</i> for example
8
-
9
- Line has embedded underscores
10
- This has some_embedded_underscores
11
- This has some_embedded_underscores
12
-
13
- Doubled underscore, midline
14
- This is __doubled, it seems
15
- This is <i>doubled,</i> it seems
16
-
17
- Line has escaped underscores
18
- This has some\_escaped\_underscores
19
- This has some_escaped_underscores
20
-
data/test/test.rb DELETED
@@ -1,140 +0,0 @@
1
- def minitest?
2
- require 'minitest/autorun'
3
- end
4
-
5
- abort "minitest gem is not installed" unless minitest?
6
-
7
-
8
- $LOAD_PATH << "./lib"
9
-
10
- require 'livetext'
11
-
12
- class TestingLivetext < MiniTest::Test
13
-
14
- TTY = File.open("/dev/tty","w")
15
-
16
- dir = ARGV.first == "cmdline" ? "../" : ""
17
- Data = "#{dir}test/data"
18
-
19
- TestLines = []
20
-
21
- Dir.chdir `livetext --path`.chomp.chomp if ARGV.first == "cmdline"
22
-
23
- Dir.chdir(Data)
24
-
25
- f = File.open("lines.txt")
26
- loop do
27
- item = []
28
- 4.times { item << f.gets.chomp }
29
- raise "Oops? #{item.inspect}" unless item.last == ""
30
- TestLines << item
31
- break if f.eof?
32
- end
33
-
34
- if File.size("subset.txt") == 0
35
- puts "Defining via TestLines"
36
- TestLines.each.with_index do |item, i|
37
- msg, src, exp, blank = *item
38
- define_method("test_formatting_#{i}") do
39
- actual = FormatLine.parse!(src)
40
- if exp[0] == "/" # regex!
41
- exp = Regexp.compile(exp[1..-2]) # skip slashes
42
- assert_match(exp, actual, msg)
43
- else
44
- assert_equal(exp, actual, msg)
45
- end
46
- end
47
- end
48
- end
49
-
50
- TestDirs = Dir.entries(".").reject {|f| ! File.directory?(f) } - %w[. ..]
51
- selected = File.readlines("subset.txt").map(&:chomp)
52
- Subset = selected.empty? ? TestDirs : selected
53
-
54
- Subset.each do |tdir|
55
- define_method("test_#{tdir}") do
56
- external_files(tdir)
57
- end
58
- end
59
-
60
- def green(str)
61
- "" + str.to_s + ""
62
- end
63
-
64
- def red(str)
65
- "" + str.to_s + ""
66
- end
67
-
68
- def external_files(base)
69
- Dir.chdir(base) do
70
- src, out, exp = "source.lt3", "/tmp/#{base}--actual-output.txt", "expected-output.txt"
71
- err, erx = "/tmp/#{base}--actual-error.txt", "expected-error.txt"
72
-
73
- # New features - match out/err by regex
74
- expout_regex = "expected-out-line1match.txt"
75
- experr_regex = "expected-err-line1match.txt"
76
-
77
- cmd = "livetext #{src} >#{out} 2>#{err}"
78
- system(cmd)
79
-
80
- output = File.read(out)
81
- errors = File.read(err)
82
- rx_out = rx_err = nil
83
-
84
- if File.exist?(expout_regex)
85
- rx_out = /#{Regexp.escape(File.read(expout_regex).chomp)}/
86
- expected = rx_out # "(match test)"
87
- else
88
- expected = File.read(exp)
89
- end
90
-
91
- if File.exist?(experr_regex)
92
- rx_err = /#{Regexp.escape(File.read(experr_regex).chomp)}/
93
- errexp = rx_err # "(match test)"
94
- else
95
- errexp = File.read(erx)
96
- end
97
-
98
- if rx_out
99
- out_ok = output =~ rx_out
100
- else
101
- out_ok = output == expected
102
- end
103
-
104
- if rx_err
105
- err_ok = errors =~ rx_err
106
- else
107
- err_ok = errors == errexp
108
- end
109
-
110
- nout = output.split("\n").size
111
- nexp = expected.split("\n").size
112
- bad_out = "--- Expected (#{nexp} lines): \n#{green(expected)}\n--- Output (#{nout} lines): \n#{red(output)}\n"
113
- bad_err = "--- Error Expected: \n#{green(errexp)}\n--- Error Output: \n#{red(errors)}\n"
114
-
115
- assert(out_ok, bad_out)
116
- assert(err_ok, bad_err)
117
- # only on success
118
- system("rm -f #{out} #{err}") if out_ok && err_ok
119
- end
120
- end
121
-
122
- end
123
-
124
-
125
- =begin
126
-
127
- You can add any ordinary test method above. But so far, all these tests simply
128
- call external_files.
129
-
130
- The external_files method works this way:
131
- - If the test (caller) method is test_my_silly_feature, then we will
132
- look for a directory called data/my_silly_feature
133
- - In here, there must be a source.lt3, expected-output.txt, and expected-error.txt
134
- - Technically, any of these can be empty
135
- - We run livetext on the source and compare actual vs expected (stdout, stderr)
136
- - The "real" output gets checked first
137
- - Of course, both must compare correctly for the test to pass
138
-
139
- =end
140
-