<commit_before>if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("all-your-base.exs", __DIR__)
end

ExUnit.start
ExUnit.configure exclude: :pending, trace: true

defmodule AllYourBaseTest do
  use ExUnit.Case

  test "convert single bit one to decimal" do
    assert AllYourBase.convert([1], 2, 10) == [1]
  end

  @tag :pending
  test "convert binary to single decimal" do
    assert AllYourBase.convert([1, 0, 1], 2, 10) == [5]
  end

  @tag :pending
  test "convert single decimal to binary" do
    assert AllYourBase.convert([5], 10, 2) == [1, 0, 1]
  end

  @tag :pending
  test "convert binary to multiple decimal" do
    assert AllYourBase.convert([1, 0, 1, 0, 1, 0], 2, 10) == [4, 2]
  end

  @tag :pending
  test "convert decimal to binary" do
    assert AllYourBase.convert([4, 2], 10, 2) == [1, 0, 1, 0, 1, 0]
  end

  @tag :pending
  test "convert trinary to hexadecimal" do
    assert AllYourBase.convert([1, 1, 2, 0], 3, 16) == [2, 10]
  end

  @tag :pending
  test "convert hexadecimal to trinary" do
    assert AllYourBase.convert([2, 10], 16, 3) == [1, 1, 2, 0]
  end

  @tag :pending
  test "convert 15-bit integer" do
    assert AllYourBase.convert([3, 46, 60], 97, 73) == [6, 10, 45]
  end

  @tag :pending
  test "convert empty list" do
    assert AllYourBase.convert([], 2, 10) == nil
  end

  @tag :pending
  test "convert single zero" do
    assert AllYourBase.convert([0], 10, 2) == [0]
  end

  @tag :pending
  test "convert multiple zeros" do
    assert AllYourBase.convert([0, 0, 0], 10, 2) == [0]
  end

  @tag :pending
  test "convert leading zeros" do
    assert AllYourBase.convert([0, 6, 0], 7, 10) == [4, 2]
  end

  @tag :pending
  test "convert negative digit" do
    assert AllYourBase.convert([1, -1, 1, 0, 1, 0], 2, 10) == nil
  end

  @tag :pending
  test "convert invalid positive digit" do
    assert AllYourBase.convert([1, 2, 1, 0, 1, 0], 2, 10) == nil
  end

  @tag :pending
  test "convert first base is one" do
    assert AllYourBase.convert([], 1, 10) == nil
  end

  @tag :pending
  test "convert second base is one" do
    assert AllYourBase.convert([1, 0, 1, 0, 1, 0], 2, 1) == nil
  end

  @tag :pending
  test "convert first base is zero" do
    assert AllYourBase.convert([], 0, 10) == nil
  end

  @tag :pending
  test "convert second base is zero" do
    assert AllYourBase.convert([7], 10, 0) == nil
  end

  @tag :pending
  test "convert first base is negative" do
    assert AllYourBase.convert([1], -2, 10) == nil
  end

  @tag :pending
  test "convert second base is negative" do
    assert AllYourBase.convert([1], 2, -7) == nil
  end

  @tag :pending
  test "convert both bases are negative" do
    assert AllYourBase.convert([1], -2, -7) == nil
  end

end<commit_msg>improve "convert first base is one" test (#389)<commit_after>if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("all-your-base.exs", __DIR__)
end

ExUnit.start
ExUnit.configure exclude: :pending, trace: true

defmodule AllYourBaseTest do
  use ExUnit.Case

  test "convert single bit one to decimal" do
    assert AllYourBase.convert([1], 2, 10) == [1]
  end

  @tag :pending
  test "convert binary to single decimal" do
    assert AllYourBase.convert([1, 0, 1], 2, 10) == [5]
  end

  @tag :pending
  test "convert single decimal to binary" do
    assert AllYourBase.convert([5], 10, 2) == [1, 0, 1]
  end

  @tag :pending
  test "convert binary to multiple decimal" do
    assert AllYourBase.convert([1, 0, 1, 0, 1, 0], 2, 10) == [4, 2]
  end

  @tag :pending
  test "convert decimal to binary" do
    assert AllYourBase.convert([4, 2], 10, 2) == [1, 0, 1, 0, 1, 0]
  end

  @tag :pending
  test "convert trinary to hexadecimal" do
    assert AllYourBase.convert([1, 1, 2, 0], 3, 16) == [2, 10]
  end

  @tag :pending
  test "convert hexadecimal to trinary" do
    assert AllYourBase.convert([2, 10], 16, 3) == [1, 1, 2, 0]
  end

  @tag :pending
  test "convert 15-bit integer" do
    assert AllYourBase.convert([3, 46, 60], 97, 73) == [6, 10, 45]
  end

  @tag :pending
  test "convert empty list" do
    assert AllYourBase.convert([], 2, 10) == nil
  end

  @tag :pending
  test "convert single zero" do
    assert AllYourBase.convert([0], 10, 2) == [0]
  end

  @tag :pending
  test "convert multiple zeros" do
    assert AllYourBase.convert([0, 0, 0], 10, 2) == [0]
  end

  @tag :pending
  test "convert leading zeros" do
    assert AllYourBase.convert([0, 6, 0], 7, 10) == [4, 2]
  end

  @tag :pending
  test "convert negative digit" do
    assert AllYourBase.convert([1, -1, 1, 0, 1, 0], 2, 10) == nil
  end

  @tag :pending
  test "convert invalid positive digit" do
    assert AllYourBase.convert([1, 2, 1, 0, 1, 0], 2, 10) == nil
  end

  @tag :pending
  test "convert first base is one" do
    assert AllYourBase.convert([0], 1, 10) == nil
  end

  @tag :pending
  test "convert second base is one" do
    assert AllYourBase.convert([1, 0, 1, 0, 1, 0], 2, 1) == nil
  end

  @tag :pending
  test "convert first base is zero" do
    assert AllYourBase.convert([], 0, 10) == nil
  end

  @tag :pending
  test "convert second base is zero" do
    assert AllYourBase.convert([7], 10, 0) == nil
  end

  @tag :pending
  test "convert first base is negative" do
    assert AllYourBase.convert([1], -2, 10) == nil
  end

  @tag :pending
  test "convert second base is negative" do
    assert AllYourBase.convert([1], 2, -7) == nil
  end

  @tag :pending
  test "convert both bases are negative" do
    assert AllYourBase.convert([1], -2, -7) == nil
  end
end
{'fraction_non_alphanumeric': 0.1355410785378212, 'fraction_numerical': 0.053564965617082884, 'mean_word_length': 3.19665907365224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2971217', 'n_tokens_mistral': 2237, 'n_tokens_neox': 1958, 'n_words': 734}