File: dyna_symbol_key_test.rb

package info (click to toggle)
ruby-power-assert 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 228 kB
  • sloc: ruby: 1,658; makefile: 5; sh: 4
file content (30 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
if defined?(RubyVM) and ! RubyVM::InstructionSequence.compile_option[:specialized_instruction]
  warn "#{__FILE__}: specialized_instruction is set to false"
end

require_relative 'test_helper'

class TestDynaSymbolKey < Test::Unit::TestCase
  include PowerAssertTestHelper

  data do
    [
      ['{"a": b}',
        [[:method, "b", 6]]],
    ].each_with_object({}) {|(source, expected_idents, expected_paths), h| h[source] = [expected_idents, expected_paths, source] }
  end
  def test_parser(*args)
    _test_parser(*args)
  end

  t do
    assert_equal <<END.chomp, assertion_message {
      {"a": 1.to_s}.nil?
              |     |
              |     false
              "1"
END
      {"a": 1.to_s}.nil?
    }
  end
end