   end
 
   test "split/3 with the :on option" do
-    assert Regex.split(~r/()abc()/, "xabcxabcx", on: :none) ==
-           ["xabcxabcx"]
-    assert Regex.split(~r/()abc()/, "xabcxabcx", on: :all_but_first) ==
-           ["x", "abc", "x", "abc", "x"]
-
-    assert Regex.split(~r/(?<first>)abc(?<last>)/, "xabcxabcx", on: [:first, :last]) ==
-           ["x", "abc", "x", "abc", "x"]
-    assert Regex.split(~r/(?<first>)abc(?<last>)/, "xabcxabcx", on: [:last, :first]) ==
-           ["xabc", "xabc", "x"]
-
-    assert Regex.split(~r/a(?<second>b)c/, "abc", on: [:second]) ==
-           ["a", "c"]
-    assert Regex.split(~r/a(?<second>b)c|a(?<fourth>d)c/, "abc adc abc", on: [:second]) ==
-           ["a", "c adc a", "c"]
+    assert Regex.split(~r/()abc()/, "xabcxabcx", on: :none) == ["xabcxabcx"]
+
+    parts = ["x", "abc", "x", "abc", "x"]
+    assert Regex.split(~r/()abc()/, "xabcxabcx", on: :all_but_first) == parts
+
+    assert Regex.split(~r/(?<first>)abc(?<last>)/, "xabcxabcx", on: [:first, :last]) == parts
+
+    parts = ["xabc", "xabc", "x"]
+    assert Regex.split(~r/(?<first>)abc(?<last>)/, "xabcxabcx", on: [:last, :first]) == parts
+
+    assert Regex.split(~r/a(?<second>b)c/, "abc", on: [:second]) == ["a", "c"]
+
+    parts = ["a", "c adc a", "c"]
+    assert Regex.split(~r/a(?<second>b)c|a(?<fourth>d)c/, "abc adc abc", on: [:second]) == parts
+
     assert Regex.split(~r/a(?<second>b)c|a(?<fourth>d)c/, "abc adc abc", on: [:second, :fourth]) ==
-           ["a", "c a", "c a", "c"]
+             ["a", "c a", "c a", "c"]
   end
 
   test "split/3 with the :include_captures option" do
     assert Regex.split(~r/([ln])/, "Erlang", include_captures: true) == ["Er", "l", "a", "n", "g"]
     assert Regex.split(~r/([kw])/, "Elixir", include_captures: true) == ["Elixir"]
-    assert Regex.split(~r/([Ee]lixir)/, "Elixir", include_captures: true, trim: true) == ["Elixir"]
-    assert Regex.split(~r/([Ee]lixir)/, "Elixir", include_captures: true, trim: false) == ["", "Elixir", ""]
+
+    parts = ["Elixir"]
+    assert Regex.split(~r/([Ee]lixir)/, "Elixir", include_captures: true, trim: true) == parts
+
+    parts = ["", "Elixir", ""]
+    assert Regex.split(~r/([Ee]lixir)/, "Elixir", include_captures: true, trim: false) == parts
   end
 
   test "replace/3,4" do

  test "literal source" do
    assert Regex.source(Regex.compile!("foo")) == "foo"
    assert Regex.source(~r"foo") == "foo"
    assert Regex.re_pattern(Regex.compile!("foo"))
           == Regex.re_pattern(~r"foo")

    assert Regex.source(Regex.compile!("\a\b\d\e\f\n\r\s\t\v")) == "\a\b\d\e\f\n\r\s\t\v"
    assert Regex.source(~r<\a\b\d\e\f\n\r\s\t\v>) == "\a\\b\\d\\e\f\n\r\\s\t\v"
    assert Regex.re_pattern(Regex.compile!("\a\b\d\e\f\n\r\s\t\v"))
           == Regex.re_pattern(~r"\a\010\177\033\f\n\r \t\v")

    assert Regex.source(Regex.compile!("\a\\b\\d\e\f\n\r\\s\t\v")) == "\a\\b\\d\e\f\n\r\\s\t\v"
    assert Regex.source(~r<\a\\b\\d\\e\f\n\r\\s\t\v>) == "\a\\\\b\\\\d\\\\e\f\n\r\\\\s\t\v"
    assert Regex.re_pattern(Regex.compile!("\a\\b\\d\e\f\n\r\\s\t\v"))
           == Regex.re_pattern(~r"\a\b\d\e\f\n\r\s\t\v")
  end

  test "Unicode" do


    assert matches_escaped?("\\A  \\z")
    assert matches_escaped?("  x  ")
    # Unicode spaces here
    assert matches_escaped?("  x    x ")
    assert matches_escaped?("# lol")

    assert matches_escaped?("\\A.^$*+?()[{\\| \t\n\x20\\z #hello\u202F\u205F")
    assert Regex.match?(Regex.compile!("[" <> Regex.escape("!-#") <> "]"), "-")

    assert Regex.escape("{}") == "\\{\\}"
    assert Regex.escape("[]") == "\\[\\]"
