@@ -434,16 +434,22 @@ module Crystal
434434 assert_macro %( {{"odelay" * 3}}) , " \" odelayodelayodelay\" "
435435 end
436436
437- it " executes split without arguments" do
438- assert_macro %( {{"1 2 3".split}}) , %( ["1", "2", "3"] of ::String)
439- end
437+ describe " #split" do
438+ it " works without arguments" do
439+ assert_macro %( {{"1 2 3".split}}) , %( ["1", "2", "3"] of ::String)
440+ end
440441
441- it " executes split with argument" do
442- assert_macro %( {{"1-2-3".split('-' )}}) , %( ["1", "2", "3"] of ::String)
443- end
442+ it " works with string argument" do
443+ assert_macro %( {{"1-2-3".split("-" )}}) , %( ["1", "2", "3"] of ::String)
444+ end
444445
445- it " executes split with char argument" do
446- assert_macro %( {{"1-2-3".split('-')}}) , %( ["1", "2", "3"] of ::String)
446+ it " works with char argument" do
447+ assert_macro %( {{"1-2-3".split('-')}}) , %( ["1", "2", "3"] of ::String)
448+ end
449+
450+ it " works with regex argument" do
451+ assert_macro %( {{"123-456-789".split(/-(.)/)}}) , %( ["123", "4", "56", "7", "89"] of ::String)
452+ end
447453 end
448454
449455 it " executes strip" do
0 commit comments