liquid-c 4.0.1 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/liquid.yml +24 -2
  3. data/.gitignore +4 -0
  4. data/.rubocop.yml +14 -0
  5. data/Gemfile +14 -5
  6. data/README.md +29 -5
  7. data/Rakefile +13 -62
  8. data/ext/liquid_c/block.c +488 -60
  9. data/ext/liquid_c/block.h +28 -2
  10. data/ext/liquid_c/c_buffer.c +42 -0
  11. data/ext/liquid_c/c_buffer.h +76 -0
  12. data/ext/liquid_c/context.c +233 -0
  13. data/ext/liquid_c/context.h +70 -0
  14. data/ext/liquid_c/document_body.c +89 -0
  15. data/ext/liquid_c/document_body.h +59 -0
  16. data/ext/liquid_c/expression.c +116 -0
  17. data/ext/liquid_c/expression.h +24 -0
  18. data/ext/liquid_c/extconf.rb +19 -9
  19. data/ext/liquid_c/intutil.h +22 -0
  20. data/ext/liquid_c/lexer.c +6 -2
  21. data/ext/liquid_c/lexer.h +18 -3
  22. data/ext/liquid_c/liquid.c +76 -6
  23. data/ext/liquid_c/liquid.h +24 -1
  24. data/ext/liquid_c/parse_context.c +76 -0
  25. data/ext/liquid_c/parse_context.h +13 -0
  26. data/ext/liquid_c/parser.c +141 -65
  27. data/ext/liquid_c/parser.h +4 -2
  28. data/ext/liquid_c/raw.c +110 -0
  29. data/ext/liquid_c/raw.h +6 -0
  30. data/ext/liquid_c/resource_limits.c +279 -0
  31. data/ext/liquid_c/resource_limits.h +23 -0
  32. data/ext/liquid_c/stringutil.h +44 -0
  33. data/ext/liquid_c/tokenizer.c +149 -35
  34. data/ext/liquid_c/tokenizer.h +20 -9
  35. data/ext/liquid_c/usage.c +18 -0
  36. data/ext/liquid_c/usage.h +9 -0
  37. data/ext/liquid_c/variable.c +196 -20
  38. data/ext/liquid_c/variable.h +18 -1
  39. data/ext/liquid_c/variable_lookup.c +44 -0
  40. data/ext/liquid_c/variable_lookup.h +8 -0
  41. data/ext/liquid_c/vm.c +588 -0
  42. data/ext/liquid_c/vm.h +25 -0
  43. data/ext/liquid_c/vm_assembler.c +491 -0
  44. data/ext/liquid_c/vm_assembler.h +240 -0
  45. data/ext/liquid_c/vm_assembler_pool.c +97 -0
  46. data/ext/liquid_c/vm_assembler_pool.h +27 -0
  47. data/lib/liquid/c/compile_ext.rb +44 -0
  48. data/lib/liquid/c/version.rb +3 -1
  49. data/lib/liquid/c.rb +225 -46
  50. data/liquid-c.gemspec +16 -10
  51. data/performance/c_profile.rb +23 -0
  52. data/performance.rb +6 -4
  53. data/rakelib/compile.rake +15 -0
  54. data/rakelib/integration_test.rake +43 -0
  55. data/rakelib/performance.rake +43 -0
  56. data/rakelib/rubocop.rake +6 -0
  57. data/rakelib/unit_test.rake +14 -0
  58. data/test/integration_test.rb +11 -0
  59. data/test/liquid_test_helper.rb +21 -0
  60. data/test/test_helper.rb +14 -2
  61. data/test/unit/block_test.rb +130 -0
  62. data/test/unit/context_test.rb +83 -0
  63. data/test/unit/expression_test.rb +186 -0
  64. data/test/unit/gc_stress_test.rb +28 -0
  65. data/test/unit/raw_test.rb +19 -0
  66. data/test/unit/resource_limits_test.rb +50 -0
  67. data/test/unit/tokenizer_test.rb +90 -20
  68. data/test/unit/variable_test.rb +212 -60
  69. metadata +59 -11
  70. data/test/liquid_test.rb +0 -11
@@ -1,110 +1,262 @@
1
1
  # encoding: utf-8
2
- require 'test_helper'
2
+ # frozen_string_literal: true
3
3
 
4
- class VariableTest < MiniTest::Unit::TestCase
4
+ require "test_helper"
5
+
6
+ class VariableTest < Minitest::Test
5
7
  def test_variable_parse
6
- assert_equal [lookup('hello'), []], variable_parse('hello')
7
- assert_equal ['world', []], variable_parse(' "world" ')
8
- assert_equal [lookup('hello["world"]'), []], variable_parse(' hello["world"] ')
9
- assert_equal [nil, []], variable_parse('')
10
- assert_equal [lookup('question?'), []], variable_parse('question?')
11
- assert_equal [lookup('[meta]'), []], variable_parse('[meta]')
12
- assert_equal [lookup('a-b'), []], variable_parse('a-b')
13
- assert_equal [lookup('a-2'), []], variable_parse('a-2')
8
+ assert_equal("world", variable_strict_parse("hello").render!({ "hello" => "world" }))
9
+ assert_equal("world", variable_strict_parse('"world"').render!)
10
+ assert_equal("answer", variable_strict_parse('hello["world"]').render!({ "hello" => { "world" => "answer" } }))
11
+ assert_equal("answer", variable_strict_parse("question?").render!({ "question?" => "answer" }))
12
+ assert_equal("value", variable_strict_parse("[meta]").render!({ "meta" => "key", "key" => "value" }))
13
+ assert_equal("result", variable_strict_parse("a-b").render!({ "a-b" => "result" }))
14
+ assert_equal("result", variable_strict_parse("a-2").render!({ "a-2" => "result" }))
14
15
  end
15
16
 
16
17
  def test_strictness
17
- assert_raises(Liquid::SyntaxError) { variable_parse(' hello["world\']" ') }
18
- assert_raises(Liquid::SyntaxError) { variable_parse('-..') }
19
- assert_raises(Liquid::SyntaxError) { variable_parse('question?mark') }
20
- assert_raises(Liquid::SyntaxError) { variable_parse('123.foo') }
21
- assert_raises(Liquid::SyntaxError) { variable_parse(' | nothing') }
22
-
23
- ['a .b', 'a. b', 'a . b'].each do |var|
24
- assert_raises(Liquid::SyntaxError) { variable_parse(var) }
25
- end
18
+ assert_raises(Liquid::SyntaxError) { variable_strict_parse(' hello["world\']" ') }
19
+ assert_raises(Liquid::SyntaxError) { variable_strict_parse(" -..") }
20
+ assert_raises(Liquid::SyntaxError) { variable_strict_parse("question?mark") }
21
+ assert_raises(Liquid::SyntaxError) { variable_strict_parse("123.foo") }
22
+ assert_raises(Liquid::SyntaxError) { variable_strict_parse(" | nothing") }
26
23
 
27
- ['a -b', 'a- b', 'a - b'].each do |var|
28
- assert_raises(Liquid::SyntaxError) { variable_parse(var) }
24
+ ["a -b", "a- b", "a - b"].each do |var|
25
+ assert_raises(Liquid::SyntaxError) { variable_strict_parse(var) }
29
26
  end
30
27
  end
31
28
 
32
29
  def test_literals
33
- assert_equal [true, []], variable_parse('true')
34
- assert_equal [nil, []], variable_parse('nil')
35
- assert_equal [123.4, []], variable_parse('123.4')
30
+ assert_equal("", variable_strict_parse("").render!)
31
+ assert_equal("true", variable_strict_parse("true").render!)
32
+ assert_equal("", variable_strict_parse("nil").render!)
33
+ assert_equal("123.4", variable_strict_parse("123.4").render!)
36
34
 
37
- assert_equal [lookup('[blank]'), []], variable_parse('[blank]')
38
- assert_equal [lookup(false, true, [Liquid::Expression::LITERALS['blank']], 0), []], variable_parse('[true][blank]')
39
- assert_equal [lookup('[true][blank]'), []], variable_parse('[true][blank]')
40
- assert_equal [lookup('x["size"]'), []], variable_parse('x["size"]')
35
+ assert_equal("blank_value", variable_strict_parse("[blank]").render!({ "" => "blank_value" }))
36
+ assert_equal("result", variable_strict_parse("[true][blank]").render!({ true => { "" => "result" } }))
37
+ assert_equal("result", variable_strict_parse('x["size"]').render!({ "x" => { "size" => "result" } }))
38
+ assert_equal("result", variable_strict_parse("blank.x").render!({ "blank" => { "x" => "result" } }))
39
+ assert_equal("result", variable_strict_parse('blank["x"]').render!({ "blank" => { "x" => "result" } }))
40
+ end
41
+
42
+ module InspectCallFilters
43
+ def filter1(input, *args)
44
+ inspect_call(__method__, input, args)
45
+ end
46
+
47
+ def filter2(input, *args)
48
+ inspect_call(__method__, input, args)
49
+ end
50
+
51
+ private
52
+
53
+ def inspect_call(filter_name, input, args)
54
+ "{ filter: #{filter_name.inspect}, input: #{input.inspect}, args: #{args.inspect} }"
55
+ end
41
56
  end
42
57
 
43
58
  def test_variable_filter
44
- name = lookup('name')
45
- assert_equal [name, [['filter', []]]], variable_parse(' name | filter ')
46
- assert_equal [name, [['filter1', []], ['filter2', []]]], variable_parse(' name | filter1 | filter2 ')
59
+ context = { "name" => "Bob" }
60
+
61
+ filter1_output = variable_strict_parse("name | filter1").render!(context, filters: [InspectCallFilters])
62
+ assert_equal('{ filter: :filter1, input: "Bob", args: [] }', filter1_output)
63
+
64
+ filter2_output = variable_strict_parse("name | filter1 | filter2").render!(context, filters: [InspectCallFilters])
65
+ assert_equal("{ filter: :filter2, input: #{filter1_output.inspect}, args: [] }", filter2_output)
47
66
  end
48
67
 
49
68
  def test_variable_filter_args
50
- name = lookup('name')
51
- abc = lookup('abc')
69
+ context = { "name" => "Bob", "abc" => "xyz" }
70
+ render_opts = { filters: [InspectCallFilters] }
71
+
72
+ filter1_output = variable_strict_parse("name | filter1: abc").render!(context, render_opts)
73
+ assert_equal('{ filter: :filter1, input: "Bob", args: ["xyz"] }', filter1_output)
52
74
 
53
- assert_equal [name, [['filter', [abc]]]], variable_parse(' name | filter: abc ')
75
+ filter2_output = variable_strict_parse("name | filter1: abc | filter2: abc").render!(context, render_opts)
76
+ assert_equal("{ filter: :filter2, input: #{filter1_output.inspect}, args: [\"xyz\"] }", filter2_output)
54
77
 
55
- assert_equal [name, [['filter1', [abc]], ['filter2', [abc]]]],
56
- variable_parse(' name | filter1: abc | filter2: abc ')
78
+ context = { "name" => "Bob", "a" => 1, "c" => 3, "e" => 5 }
57
79
 
58
- assert_equal [name, [['filter', [lookup('a')], {'b' => lookup('c'), 'd' => lookup('e')}]]],
59
- variable_parse('name | filter : a , b : c , d : e')
80
+ output = variable_strict_parse("name | filter1 : a , b : c , d : e").render!(context, render_opts)
81
+ assert_equal('{ filter: :filter1, input: "Bob", args: [1, {"b"=>3, "d"=>5}] }', output)
60
82
 
61
- assert_raises Liquid::SyntaxError do
62
- variable_parse('name | filter : a : b : c : d : e')
83
+ assert_raises(Liquid::SyntaxError) do
84
+ variable_strict_parse("name | filter : a : b : c : d : e")
63
85
  end
64
86
  end
65
87
 
66
88
  def test_unicode_strings
67
- assert_equal ['å߀êùidhtлsԁѵ߀ráƙìstɦeƅêstpcmáѕterrãcêcհèrr', []],
68
- variable_parse('"å߀êùidhtлsԁѵ߀ráƙìstɦeƅêstpcmáѕterrãcêcհèrr"')
89
+ string_content = "å߀êùidhtлsԁѵ߀ráƙìstɦeƅêstpcmáѕterrãcêcհèrr"
90
+ assert_equal(string_content, variable_strict_parse("\"#{string_content}\"").render!)
69
91
  end
70
92
 
71
93
  def test_broken_unicode_errors
72
94
  err = assert_raises(Liquid::SyntaxError) do
73
95
  Liquid::Template.parse("test {{ \xC2\xA0 test }}", error_mode: :strict)
74
96
  end
75
- assert err.message
97
+ assert(err.message)
76
98
  end
77
99
 
78
100
  def test_callbacks
79
- variable_parses = 0
80
101
  variable_fallbacks = 0
81
102
 
82
103
  callbacks = {
83
- variable_parse: lambda { variable_parses += 1 },
84
- variable_fallback: lambda { variable_fallbacks += 1 }
104
+ variable_fallback: lambda { variable_fallbacks += 1 },
85
105
  }
86
106
 
87
- create_variable('abc', error_mode: :lax, stats_callbacks: callbacks)
88
- assert_equal 1, variable_parses
89
- assert_equal 0, variable_fallbacks
107
+ Liquid::Template.parse("{{abc}}", error_mode: :lax, stats_callbacks: callbacks)
108
+ assert_equal(0, variable_fallbacks)
90
109
 
91
- create_variable('@!#', error_mode: :lax, stats_callbacks: callbacks)
92
- assert_equal 2, variable_parses
93
- assert_equal 1, variable_fallbacks
110
+ Liquid::Template.parse("{{@!#}}", error_mode: :lax, stats_callbacks: callbacks)
111
+ assert_equal(1, variable_fallbacks)
94
112
  end
95
113
 
96
- private
114
+ def test_write_string
115
+ output = Liquid::Template.parse("{{ str }}").render({ "str" => "foo" })
116
+ assert_equal("foo", output)
117
+ end
118
+
119
+ def test_write_fixnum
120
+ output = Liquid::Template.parse("{{ num }}").render({ "num" => 123456 })
121
+ assert_equal("123456", output)
122
+ end
123
+
124
+ def test_write_array
125
+ output = Liquid::Template.parse("{{ ary }}").render({ "ary" => ["foo", 123, ["nested", "ary"], nil, 0.5] })
126
+ assert_equal("foo123nestedary0.5", output)
127
+ end
128
+
129
+ def test_write_nil
130
+ output = Liquid::Template.parse("{{ obj }}").render({ "obj" => nil })
131
+ assert_equal("", output)
132
+ end
133
+
134
+ class StringConvertible
135
+ def initialize(as_string)
136
+ @as_string = as_string
137
+ end
138
+
139
+ def to_s
140
+ @as_string
141
+ end
142
+
143
+ def to_liquid
144
+ self
145
+ end
146
+ end
147
+
148
+ def test_write_to_s_convertible_object
149
+ output = Liquid::Template.parse("{{ obj }}").render!({ "obj" => StringConvertible.new("foo") })
150
+ assert_equal("foo", output)
151
+ end
152
+
153
+ def test_write_object_with_broken_to_s
154
+ template = Liquid::Template.parse("{{ obj }}")
155
+ exc = assert_raises(TypeError) do
156
+ template.render!({ "obj" => StringConvertible.new(123) })
157
+ end
158
+ assert_equal(
159
+ "VariableTest::StringConvertible#to_s returned a non-String convertible value of type Integer",
160
+ exc.message
161
+ )
162
+ end
163
+
164
+ class DerivedString < String
165
+ def to_s
166
+ self
167
+ end
168
+ end
169
+
170
+ def test_write_derived_string
171
+ output = Liquid::Template.parse("{{ obj }}").render!({ "obj" => DerivedString.new("bar") })
172
+ assert_equal("bar", output)
173
+ end
174
+
175
+ def test_filter_without_args
176
+ output = Liquid::Template.parse("{{ var | upcase }}").render({ "var" => "Hello" })
177
+ assert_equal("HELLO", output)
178
+ end
179
+
180
+ def test_filter_with_const_arg
181
+ output = Liquid::Template.parse("{{ x | plus: 2 }}").render({ "x" => 3 })
182
+ assert_equal("5", output)
183
+ end
184
+
185
+ def test_filter_with_variable_arg
186
+ output = Liquid::Template.parse("{{ x | plus: y }}").render({ "x" => 10, "y" => 123 })
187
+ assert_equal("133", output)
188
+ end
189
+
190
+ def test_filter_with_variable_arg_after_const_arg
191
+ output = Liquid::Template.parse("{{ ary | slice: 1, 2 }}").render({ "ary" => [1, 2, 3, 4] })
192
+ assert_equal("23", output)
193
+ end
194
+
195
+ def test_filter_with_const_keyword_arg
196
+ output = Liquid::Template.parse("{{ value | default: 'None' }}").render({ "value" => false })
197
+ assert_equal("None", output)
198
+
199
+ output = Liquid::Template.parse("{{ value | default: 'None', allow_false: true }}").render({ "value" => false })
200
+ assert_equal("false", output)
201
+ end
202
+
203
+ def test_filter_with_variable_keyword_arg
204
+ template = Liquid::Template.parse("{{ value | default: 'None', allow_false: false_allowed }}")
205
+
206
+ assert_equal("None", template.render({ "value" => false, "false_allowed" => false }))
207
+ assert_equal("false", template.render({ "value" => false, "false_allowed" => true }))
208
+ end
97
209
 
98
- def create_variable(markup, options={})
99
- Liquid::Variable.new(markup, Liquid::ParseContext.new(options))
210
+ def test_filter_error
211
+ output = Liquid::Template.parse("before ({{ ary | concat: 2 }}) after").render({ "ary" => [1] })
212
+ assert_equal("before (Liquid error: concat filter requires an array argument) after", output)
100
213
  end
101
214
 
102
- def variable_parse(markup)
103
- name = Liquid::Variable.c_strict_parse(markup, filters = [])
104
- [name, filters]
215
+ def test_render_variable_object
216
+ variable = Liquid::Variable.new("ary | concat: ary2", Liquid::ParseContext.new)
217
+ assert_instance_of(Liquid::C::VariableExpression, variable.name)
218
+
219
+ context = Liquid::Context.new("ary" => [1], "ary2" => [2])
220
+ assert_equal([1, 2], variable.render(context))
221
+
222
+ context["ary2"] = 2
223
+ exc = assert_raises(Liquid::ArgumentError) do
224
+ variable.render(context)
225
+ end
226
+ assert_equal("Liquid error: concat filter requires an array argument", exc.message)
105
227
  end
106
228
 
107
- def lookup(*args)
108
- Liquid::VariableLookup.new(*args)
229
+ def test_filter_argument_error_translation
230
+ variable = Liquid::Variable.new("'some words' | split", Liquid::ParseContext.new)
231
+ context = Liquid::Context.new
232
+ exc = assert_raises(Liquid::ArgumentError) { variable.render(context) }
233
+ assert_equal("Liquid error: wrong number of arguments (given 1, expected 2)", exc.message)
234
+ end
235
+
236
+ class IntegerDrop < Liquid::Drop
237
+ def initialize(value)
238
+ super()
239
+ @value = value.to_i
240
+ end
241
+
242
+ def to_liquid_value
243
+ @value
244
+ end
245
+ end
246
+
247
+ def test_to_liquid_value_on_variable_lookup
248
+ context = {
249
+ "number" => IntegerDrop.new("1"),
250
+ "list" => [1, 2, 3, 4, 5],
251
+ }
252
+
253
+ output = variable_strict_parse("list[number]").render!(context)
254
+ assert_equal("2", output)
255
+ end
256
+
257
+ private
258
+
259
+ def variable_strict_parse(markup)
260
+ Liquid::Template.parse("{{#{markup}}}", error_mode: :strict)
109
261
  end
110
262
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid-c
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Li
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-01-11 00:00:00.000000000 Z
12
+ date: 2022-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: liquid
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 3.0.0
20
+ version: 5.0.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 3.0.0
27
+ version: 5.0.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -40,7 +40,7 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.5'
42
42
  - !ruby/object:Gem::Dependency
43
- name: rake
43
+ name: minitest
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
@@ -54,7 +54,7 @@ dependencies:
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
- name: rake-compiler
57
+ name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
@@ -68,7 +68,7 @@ dependencies:
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
- name: minitest
71
+ name: rake-compiler
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ">="
@@ -105,29 +105,70 @@ extra_rdoc_files: []
105
105
  files:
106
106
  - ".github/workflows/liquid.yml"
107
107
  - ".gitignore"
108
+ - ".rubocop.yml"
108
109
  - Gemfile
109
110
  - LICENSE.txt
110
111
  - README.md
111
112
  - Rakefile
112
113
  - ext/liquid_c/block.c
113
114
  - ext/liquid_c/block.h
115
+ - ext/liquid_c/c_buffer.c
116
+ - ext/liquid_c/c_buffer.h
117
+ - ext/liquid_c/context.c
118
+ - ext/liquid_c/context.h
119
+ - ext/liquid_c/document_body.c
120
+ - ext/liquid_c/document_body.h
121
+ - ext/liquid_c/expression.c
122
+ - ext/liquid_c/expression.h
114
123
  - ext/liquid_c/extconf.rb
124
+ - ext/liquid_c/intutil.h
115
125
  - ext/liquid_c/lexer.c
116
126
  - ext/liquid_c/lexer.h
117
127
  - ext/liquid_c/liquid.c
118
128
  - ext/liquid_c/liquid.h
129
+ - ext/liquid_c/parse_context.c
130
+ - ext/liquid_c/parse_context.h
119
131
  - ext/liquid_c/parser.c
120
132
  - ext/liquid_c/parser.h
133
+ - ext/liquid_c/raw.c
134
+ - ext/liquid_c/raw.h
135
+ - ext/liquid_c/resource_limits.c
136
+ - ext/liquid_c/resource_limits.h
137
+ - ext/liquid_c/stringutil.h
121
138
  - ext/liquid_c/tokenizer.c
122
139
  - ext/liquid_c/tokenizer.h
140
+ - ext/liquid_c/usage.c
141
+ - ext/liquid_c/usage.h
123
142
  - ext/liquid_c/variable.c
124
143
  - ext/liquid_c/variable.h
144
+ - ext/liquid_c/variable_lookup.c
145
+ - ext/liquid_c/variable_lookup.h
146
+ - ext/liquid_c/vm.c
147
+ - ext/liquid_c/vm.h
148
+ - ext/liquid_c/vm_assembler.c
149
+ - ext/liquid_c/vm_assembler.h
150
+ - ext/liquid_c/vm_assembler_pool.c
151
+ - ext/liquid_c/vm_assembler_pool.h
125
152
  - lib/liquid/c.rb
153
+ - lib/liquid/c/compile_ext.rb
126
154
  - lib/liquid/c/version.rb
127
155
  - liquid-c.gemspec
128
156
  - performance.rb
129
- - test/liquid_test.rb
157
+ - performance/c_profile.rb
158
+ - rakelib/compile.rake
159
+ - rakelib/integration_test.rake
160
+ - rakelib/performance.rake
161
+ - rakelib/rubocop.rake
162
+ - rakelib/unit_test.rake
163
+ - test/integration_test.rb
164
+ - test/liquid_test_helper.rb
130
165
  - test/test_helper.rb
166
+ - test/unit/block_test.rb
167
+ - test/unit/context_test.rb
168
+ - test/unit/expression_test.rb
169
+ - test/unit/gc_stress_test.rb
170
+ - test/unit/raw_test.rb
171
+ - test/unit/resource_limits_test.rb
131
172
  - test/unit/tokenizer_test.rb
132
173
  - test/unit/variable_test.rb
133
174
  homepage: https://github.com/shopify/liquid-c
@@ -143,19 +184,26 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
184
  requirements:
144
185
  - - ">="
145
186
  - !ruby/object:Gem::Version
146
- version: '0'
187
+ version: 2.5.0
147
188
  required_rubygems_version: !ruby/object:Gem::Requirement
148
189
  requirements:
149
190
  - - ">="
150
191
  - !ruby/object:Gem::Version
151
192
  version: '0'
152
193
  requirements: []
153
- rubygems_version: 3.3.3
194
+ rubygems_version: 3.2.20
154
195
  signing_key:
155
196
  specification_version: 4
156
197
  summary: Liquid performance extension in C
157
198
  test_files:
158
- - test/liquid_test.rb
199
+ - test/integration_test.rb
200
+ - test/liquid_test_helper.rb
159
201
  - test/test_helper.rb
202
+ - test/unit/block_test.rb
203
+ - test/unit/context_test.rb
204
+ - test/unit/expression_test.rb
205
+ - test/unit/gc_stress_test.rb
206
+ - test/unit/raw_test.rb
207
+ - test/unit/resource_limits_test.rb
160
208
  - test/unit/tokenizer_test.rb
161
209
  - test/unit/variable_test.rb
data/test/liquid_test.rb DELETED
@@ -1,11 +0,0 @@
1
- liquid_lib_dir = $LOAD_PATH.detect{ |p| File.exist?(File.join(p, 'liquid.rb')) }
2
- liquid_test_dir = File.join(File.dirname(liquid_lib_dir), 'test')
3
- $LOAD_PATH << liquid_test_dir
4
-
5
- require 'test_helper'
6
- require 'liquid/c'
7
-
8
- test_files = Dir[File.join(liquid_test_dir, "integration/**/*_test.rb")]
9
- test_files.each do |test_file|
10
- require test_file
11
- end