Sha256: 92d5c068718662f7d18c069cad7d0011c5096c396fd25ed6ca6d122134bfd858
Contents?: true
Size: 948 Bytes
Versions: 31
Compression:
Stored size: 948 Bytes
Contents
require 'test/unit' require 'bitclust' require 'bitclust/simplesearcher' require 'optparse' class TestSearcher < Test::Unit::TestCase def setup s = <<HERE = class Hoge == Class Methods --- hoge = class Hoge::Bar == Class Methods --- bar = reopen Kernel == Special Variables --- $spespe --- $/ --- $$ HERE _, @db = BitClust::RRDParser.parse(s, 'hoge') end include BitClust::SimpleSearcher def test_simple_search [['Ho', 'Hoge'], ['Hoge.h', 'hoge'], ['$sp', 'spespe'], ['$/', '/'], ['$$', '$'], ['B.b', 'bar'], ['Hoge::B','Hoge::Bar'], ['B b', 'bar'], [' B b c ','bar'], ['b B', 'bar'], ].each{|q, expected| ret = search_pattern(@db, q) assert_not_equal([], ret, q) assert_equal(expected, ret[0].name, q) } assert_equal([], search_pattern(@db, " "), 'space') assert_equal([], search_pattern(@db, ""), 'blank') end end
Version data entries
31 entries across 27 versions & 1 rubygems