Sha256: 3e7bd35b1b967c964853b96375f9266e3d6eda649a8e65a30871197d16276959

Contents?: true

Size: 883 Bytes

Versions: 2

Compression:

Stored size: 883 Bytes

Contents

# -*- coding: utf-8 -*-

module ReExpand
  class ScannerTest < Test::Unit::TestCase
    def setup
    end
    
    def teardown
    end
    
    def test_1
      s = Scanner.new('a*d')
      assert_equal s.gettoken, 'a'
      assert_equal s.gettoken, '*'
      assert_equal s.gettoken, 'd'
    end
    
    def test_2
      s = Scanner.new('a+d')
      assert_equal s.gettoken, 'a'
      assert_equal s.gettoken, '+'
      assert_equal s.gettoken, 'd'
    end
    
    def test_3
      s = Scanner.new('ab*cd')
      assert_equal s.gettoken, 'ab'
      assert_equal s.gettoken, '*'
      assert_equal s.gettoken, 'cd'
    end
    
    def test_4
      s = Scanner.new("(a\tb|c\td)")
      assert_equal s.gettoken, "("
      assert_equal s.gettoken, "a\tb"
      assert_equal s.gettoken, '|'
      assert_equal s.gettoken, "c\td"
      assert_equal s.gettoken, ')'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
re_expand-0.0.6 test/test_scanner.rb
re_expand-0.0.4 test/test_scanner.rb