livetext 0.9.17 → 0.9.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/README.lt3 +2 -0
  3. data/README.md +330 -339
  4. data/bin/livetext +0 -2
  5. data/imports/bookish.rb +286 -0
  6. data/imports/calibre.rb +28 -0
  7. data/imports/livemagick.rb +133 -0
  8. data/imports/markdown.rb +44 -0
  9. data/imports/markdown_importable.rb +45 -0
  10. data/imports/pyggish.rb +172 -0
  11. data/imports/tutorial.rb +95 -0
  12. data/lib/cmdargs.rb +28 -20
  13. data/lib/formatline.rb +103 -75
  14. data/lib/functions.rb +16 -1
  15. data/lib/handler/{icanhaz.rb → import.rb} +1 -1
  16. data/lib/handler.rb +1 -1
  17. data/lib/helpers.rb +34 -8
  18. data/lib/livetext.rb +12 -5
  19. data/lib/parser/general.rb +1 -1
  20. data/lib/parser/set.rb +3 -5
  21. data/lib/parser/string.rb +11 -10
  22. data/lib/processor.rb +25 -13
  23. data/lib/standard.rb +16 -16
  24. data/lib/userapi.rb +6 -4
  25. data/livetext.gemspec +2 -1
  26. data/plugin/bookish.rb +4 -5
  27. data/plugin/markdown.rb +6 -6
  28. data/plugin/pyggish.rb +45 -77
  29. data/plugin/tutorial.rb +3 -3
  30. data/test/snapshots/error_inc_line_num/actual-error.txt +14 -0
  31. data/test/snapshots/error_inc_line_num/actual-output.txt +7 -0
  32. data/test/snapshots/error_inc_line_num/out-sdiff.txt +14 -0
  33. data/test/snapshots/error_invalid_name/actual-error.txt +10 -0
  34. data/test/snapshots/{icanhaz2/expected-error.txt → error_invalid_name/actual-output.txt} +0 -0
  35. data/test/snapshots/error_invalid_name/out-sdiff.txt +6 -0
  36. data/test/snapshots/error_missing_end/actual-error.txt +10 -0
  37. data/test/snapshots/error_missing_end/actual-output.txt +0 -0
  38. data/test/snapshots/error_missing_end/out-sdiff.txt +6 -0
  39. data/test/snapshots/error_no_such_copy/actual-error.txt +10 -0
  40. data/test/snapshots/error_no_such_copy/actual-output.txt +0 -0
  41. data/test/snapshots/error_no_such_inc/actual-error.txt +10 -0
  42. data/test/snapshots/error_no_such_inc/actual-output.txt +0 -0
  43. data/test/snapshots/error_no_such_mixin/actual-error.txt +13 -0
  44. data/test/snapshots/error_no_such_mixin/actual-output.txt +0 -0
  45. data/test/snapshots/error_no_such_mixin/out-sdiff.txt +6 -0
  46. data/test/snapshots/import/actual-error.txt +13 -0
  47. data/test/snapshots/import/actual-output.txt +0 -0
  48. data/test/snapshots/{icanhaz → import}/expected-output.txt +0 -0
  49. data/test/snapshots/{icanhaz → import}/match-error.txt +0 -0
  50. data/test/snapshots/import/out-sdiff.txt +6 -0
  51. data/test/snapshots/{icanhaz → import}/simple_import.rb +0 -0
  52. data/test/snapshots/{icanhaz → import}/source.lt3 +2 -2
  53. data/test/snapshots/import2/expected-error.txt +0 -0
  54. data/test/snapshots/{icanhaz2 → import2}/expected-output.txt +3 -1
  55. data/test/snapshots/{icanhaz2/simple_canhaz.rb → import2/simple_import.rb} +0 -0
  56. data/test/snapshots/import2/source.lt3 +8 -0
  57. data/test/snapshots/more_functions/expected-error.txt +0 -0
  58. data/test/snapshots/more_functions/expected-output.txt +37 -0
  59. data/test/snapshots/more_functions/source.lt3 +40 -0
  60. data/test/snapshots/simple_import/expected-output.txt +2 -0
  61. data/test/snapshots/simple_import/source.lt3 +3 -1
  62. data/test/snapshots/subset.txt +83 -0
  63. data/test/snapshots/wtf_bookish/expected-error.txt +0 -0
  64. data/test/snapshots/wtf_bookish/expected-output.txt +10 -0
  65. data/test/snapshots/wtf_bookish/source.lt3 +7 -0
  66. data/test/snapshots/wtf_bookish/toc.tmp +0 -0
  67. data/test/snapshots.rb +71 -46
  68. data/test/unit/formatline.rb +252 -135
  69. data/test/unit/parser/set.rb +20 -22
  70. data/test/unit/parser/string.rb +45 -6
  71. data/test/unit/standard.rb +0 -1
  72. metadata +44 -22
  73. data/lib/livetext/importable.rb +0 -2
  74. data/lib/parser/import.rb +0 -15
  75. data/test/affirm/kbks.jpg +0 -0
  76. data/test/affirm/lm-kbks.lt +0 -19
  77. data/test/cleanup +0 -1
  78. data/test/newtest +0 -14
  79. data/test/sdtest +0 -6
  80. data/test/snapshots/OMIT.txt +0 -11
  81. data/test/snapshots/clusion.txt +0 -70
  82. data/test/snapshots/crap +0 -16
  83. data/test/snapshots/fixit +0 -6
  84. data/test/snapshots/icanhaz2/source.lt3 +0 -6
@@ -13,7 +13,7 @@ class TestParseSet < MiniTest::Test
13
13
  def teardown
14
14
  end
15
15
 
16
- def ztest_one_unquoted
16
+ def test_one_unquoted
17
17
  set = ParseSet.new('my_var_123 = 789').parse
18
18
  pair = set.first
19
19
  assert_equal pair, %w[my_var_123 789]
@@ -23,38 +23,37 @@ class TestParseSet < MiniTest::Test
23
23
  assert_equal pair, %w[var_234 naked_string]
24
24
  end
25
25
 
26
- def ztest_one_single_quoted
26
+ def test_one_single_quoted
27
27
  set = ParseSet.new("fancy.var.name = 'simple string'").parse
28
28
  pair = set.first
29
29
  assert_equal pair, ["fancy.var.name", "simple string"]
30
30
  end
31
31
 
32
- def ztest_one_double_quoted
32
+ def test_one_double_quoted
33
33
  set = ParseSet.new('fancy.var2 = "another string"').parse
34
34
  pair = set.first
35
35
  assert_equal pair, ["fancy.var2", "another string"]
36
36
  end
37
37
 
38
- def ztest_multiple_unquoted
39
- puts __method__
38
+ def test_multiple_unquoted
40
39
  pair1, pair2 = ParseSet.new("this=345, that=678").parse
41
40
  assert_equal pair1, %w[this 345]
42
41
  assert_equal pair2, %w[that 678]
43
42
  end
44
43
 
45
- def ztest_multiple_unquoted_quoted
44
+ def test_multiple_unquoted_quoted
46
45
  pair1, pair2 = ParseSet.new('alpha = 567, beta = "oh well"').parse
47
46
  assert_equal pair1, %w[alpha 567]
48
47
  assert_equal pair2, ["beta", "oh well"]
49
48
  end
50
49
 
51
- def ztest_quote_embedded_comma
50
+ def test_quote_embedded_comma
52
51
  set = ParseSet.new('gamma = "oh, well"').parse
53
52
  pair = set.first
54
53
  assert_equal pair, ["gamma", "oh, well"]
55
54
  end
56
55
 
57
- def ztest_get_var
56
+ def test_get_var
58
57
  @parse = ParseSet.new("foo=345")
59
58
  assert_equal @parse.get_var, "foo"
60
59
  @parse = ParseSet.new("foo = 345")
@@ -79,7 +78,7 @@ puts __method__
79
78
  assert_raises(BadVariableName) { @parse.get_var }
80
79
  end
81
80
 
82
- def ztest_skip_equal
81
+ def test_skip_equal
83
82
  @parse = ParseSet.new("=")
84
83
  assert_nil @parse.skip_equal
85
84
  @parse = ParseSet.new(" = ")
@@ -97,7 +96,7 @@ puts __method__
97
96
  assert_raises(NoEqualSign) { @parse.skip_equal }
98
97
  end
99
98
 
100
- def ztest_quoted_value
99
+ def test_quoted_value
101
100
  @parse = ParseSet.new(%['this'])
102
101
  assert_equal @parse.quoted_value, "this"
103
102
  @parse = ParseSet.new(%["that"])
@@ -119,7 +118,7 @@ puts __method__
119
118
  # - allow (escaped?) comma in quoted string
120
119
  end
121
120
 
122
- def ztest_unquoted_value
121
+ def test_unquoted_value
123
122
  # Note: an unquoted value is still a string!
124
123
  @parse = ParseSet.new(%[342 ])
125
124
  assert_equal @parse.unquoted_value, "342"
@@ -138,27 +137,26 @@ puts __method__
138
137
  # - allow/disallow escaping??
139
138
  end
140
139
 
141
- # BUG: FormatLine doesn't know variables in this context!
142
-
143
- def xtest_4 # FIXME
140
+ def test_var_eq_var
144
141
  set = ParseSet.new("file = $File").parse
142
+ set = set.first # [["var", "value"]]
145
143
  assert_equal set.first, "file"
146
- assert set.last !~ /undefined/
144
+ assert set.last =~ /undefined/, "Found 'undefined' for variable value"
145
+ # ^ ParseSet isn't smart enough to know about variables/functions
147
146
  end
148
147
 
149
- # BUG: ...or functions.
150
- # (Additional bug: Failing silently seems wrong.)
151
-
152
- def xtest_5 # FIXME
148
+ def test_var_eq_func
153
149
  set = ParseSet.new("date = $$date").parse
150
+ set = set.first # [["var", "value"]]
154
151
  assert_equal set.first, "date"
155
- assert set.last =~ /^\d\d.\d\d.\d\d/
152
+ assert set.last =~ /undefined/, "Found 'undefined' for variable value"
153
+ # ^ ParseSet isn't smart enough to know about variables/functions
156
154
  end
157
155
 
158
156
  def test_two_strings
159
- line = %[bday="May_31", date="5/31"]
157
+ line = %[bday="May 31", date='5/31']
160
158
  set = ParseSet.new(line).parse
161
- assert set == [["bday", "May_31"], ["date", "5/31"]]
159
+ assert set == [["bday", "May 31"], ["date", "5/31"]]
162
160
  end
163
161
 
164
162
  end
@@ -81,20 +81,16 @@ class TestStringParser < MiniTest::Test
81
81
  assert_nil char1
82
82
  assert_nil char2
83
83
  assert @zero.i == 0
84
- assert @zero.last?
85
84
  assert @zero.eos?
86
85
 
87
- refute @one.last? # FIXME??
88
86
  char1 = @one.peek
89
- refute @one.last? # FIXME??
90
87
  char2 = @one.grab
91
88
  char3 = @one.peek
92
89
  assert char1
93
90
  assert char2 == char1
94
91
  assert char3 == @str1[1]
95
92
  assert @one.i == 1
96
- assert @one.last?
97
- assert @one.eos? # FIXME??
93
+ assert @one.eos?
98
94
 
99
95
  char1 = @many.peek
100
96
  char2 = @many.grab
@@ -103,7 +99,6 @@ class TestStringParser < MiniTest::Test
103
99
  assert char2 == char1
104
100
  assert char3 == @strN[1]
105
101
  assert @many.i == 1
106
- refute @many.last?
107
102
  refute @many.eos?
108
103
  end
109
104
 
@@ -126,5 +121,49 @@ class TestStringParser < MiniTest::Test
126
121
  refute some.peek == " "
127
122
  assert_equal some.peek, "x"
128
123
  assert_equal some.i, 3
124
+
125
+ some = StringParser.new("abc 123")
126
+ 3.times { some.grab }
127
+ assert_equal some.peek, " "
128
+ some.skip_spaces
129
+ refute some.peek == " "
130
+ assert_equal some.peek, "1"
131
+ assert_equal some.i, 6
132
+ end
133
+
134
+ def test_ungrab
135
+ parse = StringParser.new("abcdef")
136
+ assert_equal parse.i, 0
137
+ assert_equal parse.peek, "a"
138
+ 3.times { parse.grab }
139
+ assert_equal parse.i, 3
140
+ assert_equal parse.peek, "d"
141
+ parse.ungrab
142
+ assert_equal parse.i, 2
143
+ assert_equal parse.peek, "c"
144
+ end
145
+
146
+ def test_lookahead
147
+ parse = StringParser.new("abcdef")
148
+ assert_equal parse.peek, "a"
149
+ assert_equal parse.lookahead, "b"
150
+ assert_equal parse.i, 0
151
+ 3.times { parse.grab }
152
+ before = parse.i
153
+ assert_equal parse.lookahead, "e"
154
+ after = parse.i
155
+ assert_equal before, after
156
+ end
157
+
158
+ def test_prev
159
+ parse = StringParser.new("abcdef")
160
+ assert_nil parse.prev
161
+ assert_equal parse.i, 0
162
+ 3.times { parse.grab }
163
+ before = parse.i
164
+ assert_equal parse.prev, "c"
165
+ after = parse.i
166
+ assert_equal before, after
129
167
  end
168
+
130
169
  end
@@ -1,6 +1,5 @@
1
1
  require 'minitest/autorun'
2
2
 
3
-
4
3
  require_relative '../../lib/livetext'
5
4
 
6
5
  class TestingLivetext < MiniTest::Test
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.17
4
+ version: 0.9.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-10 00:00:00.000000000 Z
11
+ date: 2022-01-14 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,20 +20,25 @@ files:
20
20
  - "./README.lt3"
21
21
  - "./README.md"
22
22
  - bin/livetext
23
+ - imports/bookish.rb
24
+ - imports/calibre.rb
25
+ - imports/livemagick.rb
26
+ - imports/markdown.rb
27
+ - imports/markdown_importable.rb
28
+ - imports/pyggish.rb
29
+ - imports/tutorial.rb
23
30
  - lib/cmdargs.rb
24
31
  - lib/errors.rb
25
32
  - lib/formatline.rb
26
33
  - lib/functions.rb
27
34
  - lib/handler.rb
28
- - lib/handler/icanhaz.rb
35
+ - lib/handler/import.rb
29
36
  - lib/helpers.rb
30
37
  - lib/html.rb
31
38
  - lib/livetext.rb
32
- - lib/livetext/importable.rb
33
39
  - lib/parser.rb
34
40
  - lib/parser/file.rb
35
41
  - lib/parser/general.rb
36
- - lib/parser/import.rb
37
42
  - lib/parser/mixin.rb
38
43
  - lib/parser/set.rb
39
44
  - lib/parser/string.rb
@@ -47,21 +52,14 @@ files:
47
52
  - plugin/markdown.rb
48
53
  - plugin/pyggish.rb
49
54
  - plugin/tutorial.rb
50
- - test/affirm/kbks.jpg
51
- - test/affirm/lm-kbks.lt
52
55
  - test/all.rb
53
- - test/cleanup
54
- - test/newtest
55
- - test/sdtest
56
56
  - test/snapshots.rb
57
- - test/snapshots/OMIT.txt
58
57
  - test/snapshots/basic_formatting/expected-error.txt
59
58
  - test/snapshots/basic_formatting/expected-output.txt
60
59
  - test/snapshots/basic_formatting/source.lt3
61
60
  - test/snapshots/block_comment/expected-error.txt
62
61
  - test/snapshots/block_comment/expected-output.txt
63
62
  - test/snapshots/block_comment/source.lt3
64
- - test/snapshots/clusion.txt
65
63
  - test/snapshots/comments_ignored_1/expected-error.txt
66
64
  - test/snapshots/comments_ignored_1/expected-output.txt
67
65
  - test/snapshots/comments_ignored_1/source.lt3
@@ -69,16 +67,21 @@ files:
69
67
  - test/snapshots/copy_is_raw/expected-output.txt
70
68
  - test/snapshots/copy_is_raw/rawtext.inc
71
69
  - test/snapshots/copy_is_raw/source.lt3
72
- - test/snapshots/crap
73
70
  - test/snapshots/def_method/expected-error.txt
74
71
  - test/snapshots/def_method/expected-output.txt
75
72
  - test/snapshots/def_method/source.lt3
73
+ - test/snapshots/error_inc_line_num/actual-error.txt
74
+ - test/snapshots/error_inc_line_num/actual-output.txt
76
75
  - test/snapshots/error_inc_line_num/expected-output.txt
77
76
  - test/snapshots/error_inc_line_num/file2.lt3
78
77
  - test/snapshots/error_inc_line_num/match-error.txt
78
+ - test/snapshots/error_inc_line_num/out-sdiff.txt
79
79
  - test/snapshots/error_inc_line_num/source.lt3
80
+ - test/snapshots/error_invalid_name/actual-error.txt
81
+ - test/snapshots/error_invalid_name/actual-output.txt
80
82
  - test/snapshots/error_invalid_name/expected-output.txt
81
83
  - test/snapshots/error_invalid_name/match-error.txt
84
+ - test/snapshots/error_invalid_name/out-sdiff.txt
82
85
  - test/snapshots/error_invalid_name/source.lt3
83
86
  - test/snapshots/error_line_num/expected-output.txt
84
87
  - test/snapshots/error_line_num/match-error.txt
@@ -86,20 +89,30 @@ files:
86
89
  - test/snapshots/error_mismatched_end/expected-output.txt
87
90
  - test/snapshots/error_mismatched_end/match-error.txt
88
91
  - test/snapshots/error_mismatched_end/source.lt3
92
+ - test/snapshots/error_missing_end/actual-error.txt
93
+ - test/snapshots/error_missing_end/actual-output.txt
89
94
  - test/snapshots/error_missing_end/expected-output.txt
90
95
  - test/snapshots/error_missing_end/match-error.txt
96
+ - test/snapshots/error_missing_end/out-sdiff.txt
91
97
  - test/snapshots/error_missing_end/source.lt3
92
98
  - test/snapshots/error_name_not_permitted/expected-output.txt
93
99
  - test/snapshots/error_name_not_permitted/match-error.txt
94
100
  - test/snapshots/error_name_not_permitted/source.lt3
101
+ - test/snapshots/error_no_such_copy/actual-error.txt
102
+ - test/snapshots/error_no_such_copy/actual-output.txt
95
103
  - test/snapshots/error_no_such_copy/expected-output.txt
96
104
  - test/snapshots/error_no_such_copy/match-error.txt
97
105
  - test/snapshots/error_no_such_copy/source.lt3
106
+ - test/snapshots/error_no_such_inc/actual-error.txt
107
+ - test/snapshots/error_no_such_inc/actual-output.txt
98
108
  - test/snapshots/error_no_such_inc/expected-output.txt
99
109
  - test/snapshots/error_no_such_inc/match-error.txt
100
110
  - test/snapshots/error_no_such_inc/source.lt3
111
+ - test/snapshots/error_no_such_mixin/actual-error.txt
112
+ - test/snapshots/error_no_such_mixin/actual-output.txt
101
113
  - test/snapshots/error_no_such_mixin/expected-output.txt
102
114
  - test/snapshots/error_no_such_mixin/match-error.txt
115
+ - test/snapshots/error_no_such_mixin/out-sdiff.txt
103
116
  - test/snapshots/error_no_such_mixin/source.lt3
104
117
  - test/snapshots/example_alpha/expected-error.txt
105
118
  - test/snapshots/example_alpha/expected-output.txt
@@ -107,24 +120,29 @@ files:
107
120
  - test/snapshots/example_alpha2/expected-error.txt
108
121
  - test/snapshots/example_alpha2/expected-output.txt
109
122
  - test/snapshots/example_alpha2/source.lt3
110
- - test/snapshots/fixit
111
123
  - test/snapshots/functions/expected-error.txt
112
124
  - test/snapshots/functions/expected-output.txt
113
125
  - test/snapshots/functions/source.lt3
114
126
  - test/snapshots/hello_world/expected-error.txt
115
127
  - test/snapshots/hello_world/expected-output.txt
116
128
  - test/snapshots/hello_world/source.lt3
117
- - test/snapshots/icanhaz/expected-output.txt
118
- - test/snapshots/icanhaz/match-error.txt
119
- - test/snapshots/icanhaz/simple_import.rb
120
- - test/snapshots/icanhaz/source.lt3
121
- - test/snapshots/icanhaz2/expected-error.txt
122
- - test/snapshots/icanhaz2/expected-output.txt
123
- - test/snapshots/icanhaz2/simple_canhaz.rb
124
- - test/snapshots/icanhaz2/source.lt3
129
+ - test/snapshots/import/actual-error.txt
130
+ - test/snapshots/import/actual-output.txt
131
+ - test/snapshots/import/expected-output.txt
132
+ - test/snapshots/import/match-error.txt
133
+ - test/snapshots/import/out-sdiff.txt
134
+ - test/snapshots/import/simple_import.rb
135
+ - test/snapshots/import/source.lt3
136
+ - test/snapshots/import2/expected-error.txt
137
+ - test/snapshots/import2/expected-output.txt
138
+ - test/snapshots/import2/simple_import.rb
139
+ - test/snapshots/import2/source.lt3
125
140
  - test/snapshots/more_complex_vars/expected-error.txt
126
141
  - test/snapshots/more_complex_vars/expected-output.txt
127
142
  - test/snapshots/more_complex_vars/source.lt3
143
+ - test/snapshots/more_functions/expected-error.txt
144
+ - test/snapshots/more_functions/expected-output.txt
145
+ - test/snapshots/more_functions/source.lt3
128
146
  - test/snapshots/predef_vars/expected-error.txt
129
147
  - test/snapshots/predef_vars/match-output.txt
130
148
  - test/snapshots/predef_vars/source.lt3
@@ -161,6 +179,10 @@ files:
161
179
  - test/snapshots/table_with_heredocs/expected-error.txt
162
180
  - test/snapshots/table_with_heredocs/expected-output.txt
163
181
  - test/snapshots/table_with_heredocs/source.lt3
182
+ - test/snapshots/wtf_bookish/expected-error.txt
183
+ - test/snapshots/wtf_bookish/expected-output.txt
184
+ - test/snapshots/wtf_bookish/source.lt3
185
+ - test/snapshots/wtf_bookish/toc.tmp
164
186
  - test/testlines.rb
165
187
  - test/unit/all.rb
166
188
  - test/unit/formatline.rb
@@ -1,2 +0,0 @@
1
- class LiveText::Importable
2
- end
data/lib/parser/import.rb DELETED
@@ -1,15 +0,0 @@
1
-
2
- require '../livetext/importable'
3
-
4
- make_exception(:BadVariableName, "Error: invalid variable name")
5
- make_exception(:NoEqualSign, "Error: no equal sign found")
6
-
7
- class Livetext::Handler::Import
8
- def use_import(name)
9
- require name
10
- include name
11
- init = "init_#{name}"
12
- self.send(init) if self.respond_to? init
13
- end
14
- end
15
-
data/test/affirm/kbks.jpg DELETED
Binary file
@@ -1,19 +0,0 @@
1
- .mixin livemagick
2
-
3
- .nopass
4
-
5
- .image 300 100 lightgray
6
- .canvas green 1 0
7
- .pen red red
8
- .font 80 Arial
9
-
10
- .rectangle 100,50 300x300 green 9
11
-
12
- .text! 100,50 100x100
13
- K B K Z
14
- .end
15
- .draw
16
- .save! myfile.jpg
17
-
18
- .def foobar
19
-
data/test/cleanup DELETED
@@ -1 +0,0 @@
1
- find testfiles -name actual-*.txt | xargs rm
data/test/newtest DELETED
@@ -1,14 +0,0 @@
1
- mkdir test/data/$1
2
-
3
- # actual-error.txt actual-output.txt expected-error.txt expected-output.txt source.lt3
4
-
5
- cd test/data/$1
6
-
7
- touch expected-output.txt expected-error.txt
8
-
9
- vi source.lt3
10
-
11
- livetext source.lt3 >expected-output.txt 2>expected-error.txt
12
-
13
- vi -O source.lt3 expected-output.txt expected-error.txt
14
-
data/test/sdtest DELETED
@@ -1,6 +0,0 @@
1
-
2
- sdiff test/data/$1/expected-output.txt /tmp/$1--actual-output.txt
3
-
4
- echo ==========
5
-
6
- sdiff test/data/$1/expected-error.txt /tmp/$1--actual-error.txt
@@ -1,11 +0,0 @@
1
- # Comments are ignored.
2
- # Other lines: name_of_snapshot and any comments here are ignored (no # needed)
3
- # fake_test_name Use # to un-omit ;)
4
- error_no_such_inc Output BEFORE error doesn't get passed through
5
- error_no_such_copy ^ Same behavior as error_no_such_inc
6
- error_no_such_mixin ^ Same behavior as error_missing_end
7
- error_invalid_name ^ Same behavior as error_no_such_inc
8
- error_missing_end Output is duplicated somehow. Look for: puts @body or puts @main.body
9
- error_inc_line_num Forgot what's wrong here
10
- simple_import Not coded yet
11
- icanhaz Dummy command similar to import/mixin
@@ -1,70 +0,0 @@
1
- # This file specifies which snapshots will/won't be run.
2
-
3
- # Blank lines and comments are ignored.
4
- # Other lines: name_of_snapshot and any comments here are ignored (no # needed)
5
-
6
- # i to include, x to exclude
7
-
8
- x error_no_such_inc # Output BEFORE error doesn't get passed through ("leading" output)
9
- x error_no_such_copy # ^ Same behavior as error_no_such_inc
10
- x error_no_such_mixin # ^ Same behavior as error_missing_end
11
- x error_invalid_name # ^ Same behavior as error_no_such_inc
12
- x error_missing_end # Output is duplicated somehow. Look for: puts @body or puts @main.body
13
- x error_inc_line_num # Forgot what's wrong here
14
-
15
- # Dummy command .icanhaz works like .mixin or .import
16
-
17
- x icanhaz # "Leading" output doesn't get generated (same as error_no_such_inc)
18
- icanhaz2
19
-
20
- # Others (usually passing):
21
-
22
- # import/include/mixin, others...
23
-
24
- simple_copy #
25
- simple_import #
26
- simple_include #
27
- simple_mixin #
28
-
29
- # raw input
30
-
31
- single_raw_line #
32
- raw_lines #
33
- raw_text_block #
34
- copy_is_raw #
35
-
36
- # comments
37
-
38
- block_comment #
39
- comments_ignored_1 #
40
-
41
- # variables and heredocs
42
-
43
- predef_vars #
44
- simple_vars #
45
- more_complex_vars #
46
- table_with_heredocs #
47
-
48
- # testing def
49
-
50
- def_method #
51
-
52
- # intraline formatting
53
-
54
- basic_formatting #
55
-
56
- # Errors
57
-
58
- error_line_num #
59
- error_mismatched_end #
60
- error_name_not_permitted #
61
-
62
- # functions
63
-
64
- functions #
65
-
66
- # More/misc...
67
-
68
- example_alpha #
69
- example_alpha2 #
70
- hello_world #
data/test/snapshots/crap DELETED
@@ -1,16 +0,0 @@
1
- ./fixit block_comment
2
- ./fixit comments_ignored_1
3
- ./fixit comments_ignored_2
4
- ./fixit copy_is_raw
5
- ./fixit def_method
6
- ./fixit example_alpha
7
- ./fixit example_alpha2
8
- ./fixit hello_world
9
- ./fixit more_complex_vars
10
- ./fixit raw_text_block
11
- ./fixit sigil_can_change
12
- ./fixit simple_copy
13
- ./fixit simple_include
14
- ./fixit simple_mixin
15
- ./fixit simple_vars
16
- ./fixit single_raw_line
data/test/snapshots/fixit DELETED
@@ -1,6 +0,0 @@
1
- cd $1
2
- mv $1.err actual-error.txt
3
- mv $1.erx expected-error.txt
4
- mv $1.exp expected-output.txt
5
- mv $1.lt3 source.lt3
6
- mv $1.out actual-output.txt
@@ -1,6 +0,0 @@
1
- Testing fake command .icanhaz:
2
-
3
- .icanhaz simple_canhaz
4
- Now call a method:
5
- .hello_world
6
- That's all.