Sha256: cdeb3d250349bf17b0d857803b14f563000732b79bcc8e67fe9e64284b6dd9a0

Contents?: true

Size: 1.27 KB

Versions: 12

Compression:

Stored size: 1.27 KB

Contents

#
# Testing OpenWFE (Kotoba)
#
# John Mettraux at openwfe.org
#
# Sun Mar 18 13:29:37 JST 2007
#

require 'test/unit'
require 'openwfe/util/kotoba'

#
# testing misc things
#

class KotobaTest < Test::Unit::TestCase

    #def setup
    #end

    #def teardown
    #end

    def test_kotoba
        t = Time.now
        #puts t.to_f
        
        st = t.to_f * 1000 * 10
        
        #puts st
        
        st = Integer(st) % (10 * 1000 * 60 * 60)
        #st = 28340469
        
        s = Kotoba::from_integer(st)
        
        st2 = Kotoba::to_integer(s)
        s2 = Kotoba::from_integer(st2)
        
        #puts st
        #puts s
        
        #puts st2
        #puts s2

        assert_equal s, s2
        assert_equal st, st2

        a = Kotoba::split(s)

        assert_equal a.join, s

        #puts Kotoba::to_integer("tunashima")
        #puts Kotoba::to_integer("tsunashima")

        assert Kotoba::is_kotoba_word("takeshi")

        assert Kotoba::is_kotoba_word("tsunasima")
        assert Kotoba::is_kotoba_word("tunashima")

        assert (not Kotoba::is_kotoba_word("dsfadf"))
        assert (not Kotoba::is_kotoba_word("takeshin"))
    end
end

#require 'pp'
#pp Kotoba::split(s2)
#
#puts Kotoba::is_kotoba_word("asdfadsg")
#puts Kotoba::is_kotoba_word(s2)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
openwferu-0.9.10 test/kotoba_test.rb
openwferu-0.9.10.653 test/kotoba_test.rb
openwferu-0.9.11 test/kotoba_test.rb
openwferu-0.9.12 test/kotoba_test.rb
openwferu-0.9.12.863 test/kotoba_test.rb
openwferu-0.9.13 test/kotoba_test.rb
openwferu-0.9.14 test/kotoba_test.rb
openwferu-0.9.15 test/kotoba_test.rb
openwferu-0.9.16 test/kotoba_test.rb
openwferu-0.9.7 test/kotoba_test.rb
openwferu-0.9.8 test/kotoba_test.rb
openwferu-0.9.9 test/kotoba_test.rb