jordansissel/grok — Issue #6: pure-ruby grok fails tests
Author: crankycoder
Created: 2011-10-12 19:44:59+00:00
State: open

I just installed jls-grok 0.9.0 and when I fetch code from the github repository and manually run tests, I get this:

/Users/victorng/dev/grok/ruby/test/pure-ruby $ jruby alltests.rb

Loading tests: ./general/basic_test.rb
Loading tests: ./general/captures_test.rb
Loading tests: ./patterns/day.rb
Loading tests: ./patterns/host.rb
Loading tests: ./patterns/ip.rb
Loading tests: ./patterns/iso8601.rb
Loading tests: ./patterns/month.rb
Loading tests: ./patterns/number.rb
Loading tests: ./patterns/path.rb
Loading tests: ./patterns/prog.rb
Loading tests: ./patterns/quotedstring.rb
Loading tests: ./patterns/uri.rb
Loaded suite alltests
Started
E..EE..EEEEEFEEEEEEEEEEEEEEEEEEEE
Finished in 0.524 seconds.

1) Error:
test_days(DayPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/day.rb:10:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

2) Error:
test_grok_expanded_pattern_works_correctly(GrokBasicTests):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/basic_test.rb:45:in `test_grok_expanded_pattern_works_correctly'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

3) Error:
test_grok_load_patterns_from_file(GrokBasicTests):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/basic_test.rb:55:in `test_grok_load_patterns_from_file'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

4) Error:
test_basic_capture(GrokPatternCapturingTests):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/captures_test.rb:23:in `test_basic_capture'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

5) Error:
test_capture_methods(GrokPatternCapturingTests):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/captures_test.rb:12:in `test_capture_methods'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

6) Error:
test_multiple_captures(GrokPatternCapturingTests):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/captures_test.rb:64:in `test_multiple_captures'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

7) Error:
test_multiple_captures_with_same_name(GrokPatternCapturingTests):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/captures_test.rb:52:in `test_multiple_captures_with_same_name'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

8) Error:
test_nested_captures(GrokPatternCapturingTests):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/captures_test.rb:77:in `test_nested_captures'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

9) Failure:
test_nesting_recursion(GrokPatternCapturingTests)
[./general/captures_test.rb:89:in `test_nesting_recursion'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each']:
exception expected but was
Class:
Message: <"can't convert String into Integer">
---Backtrace---
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/captures_test.rb:90:in `test_nesting_recursion'
./general/captures_test.rb:89:in `test_nesting_recursion'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'
---------------

10) Error:
test_valid_capture_subnames(GrokPatternCapturingTests):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./general/captures_test.rb:98:in `test_valid_capture_subnames'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

11) Error:
test_hosts(HostPattternTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/host.rb:10:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

12) Error:
test_ips(IPPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/ip.rb:13:in `test_ips'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

13) Error:
test_non_ips(IPPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/ip.rb:23:in `test_non_ips'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

14) Error:
test_iso8601(ISO8601PatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/iso8601.rb:10:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

15) Error:
test_iso8601_nomatch(ISO8601PatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/iso8601.rb:10:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

16) Error:
test_months(MonthPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/month.rb:10:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

17) Error:
test_match_base16num(NumberPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/number.rb:58:in `test_match_base16num'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

18) Error:
test_match_number(NumberPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/number.rb:13:in `test_match_number'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

19) Error:
test_match_number_amid_things(NumberPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/number.rb:37:in `test_match_number_amid_things'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

20) Error:
test_match_number_float(NumberPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/number.rb:27:in `test_match_number_float'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

21) Error:
test_no_match_number(NumberPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/number.rb:50:in `test_no_match_number'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

22) Error:
test_unix_paths(PathPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/path.rb:10:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

23) Error:
test_windows_paths(PathPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/path.rb:10:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

24) Error:
test_progs(ProgPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/prog.rb:9:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

25) Error:
test_escaped_quotes_no_match_quoted_string(QuotedStringPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/quotedstring.rb:38:in `test_escaped_quotes_no_match_quoted_string'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

26) Error:
test_non_quoted_strings_no_match(QuotedStringPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/quotedstring.rb:47:in `test_non_quoted_strings_no_match'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

27) Error:
test_quoted_string_common(QuotedStringPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/quotedstring.rb:13:in `test_quoted_string_common'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

28) Error:
test_quoted_string_inside_escape(QuotedStringPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/quotedstring.rb:27:in `test_quoted_string_inside_escape'
org/jruby/RubyKernel.java:2092:in `send'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

29) Error:
test_urls(URIPatternsTest):
TypeError: can't convert String into Integer
org/jruby/RubyArray.java:1338:in `[]'
org/jruby/RubyMatchData.java:403:in `[]'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in `compile'
org/jruby/RubyKernel.java:1419:in `loop'
/Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in `compile'
./patterns/uri.rb:9:in `setup'
org/jruby/RubyArray.java:1603:in `each'
org/jruby/RubyArray.java:1603:in `each'

33 tests, 14 assertions, 1 failures, 28 errors