Ruby Unit Test
1 require 'test/unit' 2 3 module Test::Unit::Assertions 4 def assert_equal_unorder(exp, act, msg = nil) 5 # msg = message(msg) {} 6 assert_equal(exp.to_set, act.to_set, msg) 7 end 8 end 9 10 class TestKitty < Test::Unit::TestCase 11 def test_kitty 12 assert_equal_unorder([[]], partition("")) 13 assert_equal_unorder([["a"]], partition("a")) 14 assert_equal_unorder([["aa"], ["a", "a"]], partition("aa")) 15 assert_equal_unorder([["a", "a"], ["aa"]], partition("aa")) 16 assert_equal_unorder([["a", "b"]], partition("ab")) 17 assert_equal_unorder([["aa","b"], ["a","a","b"]], partition("aab")) 18 end 19 end
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步