     assert test_is_even_in_guards(11) == false
   end
 
-  test "digits" do
-    assert Integer.digits(101) == [1, 0, 1]
-    assert Integer.digits(1) == [1]
+  test "digits/2" do
     assert Integer.digits(0) == [0]
     assert Integer.digits(0, 2) == [0]
+    assert Integer.digits(1) == [1]
+    assert Integer.digits(123, 123) == [1, 0]
+    assert Integer.digits(123) == [1, 2, 3]
     assert Integer.digits(58127, 2) == [1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]
-    assert Integer.digits(987654, 987654) == [1, 0]
+
+    for n <- Enum.to_list(-1..1) do
+      assert_raise FunctionClauseError, fn ->
+        Integer.digits(10, n)
+      end
+    end
   end
 
-  test "undigits" do
+  test "undigits/2" do
+    assert Integer.undigits([]) == 0
+    assert Integer.undigits([0]) == 0
+    assert Integer.undigits([1]) == 1
     assert Integer.undigits([1, 0, 1]) == 101
-    assert Integer.undigits([1]) == 1
-    assert Integer.undigits([0]) == 0
-    assert Integer.undigits([]) == 0
     assert Integer.undigits([1, 4], 16) == 0x14
     assert Integer.undigits([1, 4], 8) == 0o14
     assert Integer.undigits([1, 1], 2) == 0b11
     assert Integer.undigits([1, 2, 3, 4, 5]) == 12345
     assert Integer.undigits([1, 0, -5]) == 95
     assert Integer.undigits([-1, -1, -5]) == -115
+
+    for n <- Enum.to_list(-1..1) do
+      assert_raise FunctionClauseError, fn ->
+        Integer.undigits([1, 0, 1], n)
+      end
+    end
   end
 
-  test "parse" do
+  test "parse/2" do
     assert Integer.parse("12") === {12, ""}
+    assert Integer.parse("012") === {12, ""}
     assert Integer.parse("+12") === {12, ""}
     assert Integer.parse("-12") === {-12, ""}
     assert Integer.parse("123456789") === {123456789, ""}

  def test_is_even_in_guards(_number),
    do: false

  test "is_odd" do
    assert Integer.is_odd(0) == false
    assert Integer.is_odd(1) == true
    assert Integer.is_odd(2) == false

    assert test_is_odd_in_guards(11) == 11
  end

  test "is_even/1" do
    assert Integer.is_even(0) == true
    assert Integer.is_even(1) == false
    assert Integer.is_even(2) == true
