Sha256: ac81c1cf4954c95964a26961f50166d2edf2ba9cb5d11da5bef96e65c62e5072

Contents?: true

Size: 855 Bytes

Versions: 263

Compression:

Stored size: 855 Bytes

Contents

if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("luhn.exs", __DIR__)
end

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

defmodule LuhnTest do
  use ExUnit.Case

  test "checksum" do
    assert Luhn.checksum("4913") == 22
  end

  @tag :pending
  test "checksum again" do
    assert Luhn.checksum("201773") == 21
  end

  @tag :pending
  test "invalid number" do
    assert Luhn.valid?("738") == false
  end

  @tag :pending
  test "valid number" do
    assert Luhn.valid?("8739567") == true
  end

  @tag :pending
  test "create valid number" do
    assert Luhn.create("123") == "1230"
  end

  @tag :pending
  test "create other valid number" do
    assert Luhn.create("873956") == "8739567"
  end

  @tag :pending
  test "create yet another valid number" do
    assert Luhn.create("837263756") == "8372637564"
  end
end

Version data entries

263 entries across 263 versions & 1 rubygems

Version Path
trackler-2.2.1.46 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.45 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.44 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.43 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.42 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.41 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.40 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.39 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.38 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.37 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.36 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.35 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.34 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.33 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.32 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.31 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.30 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.29 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.28 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.2.1.27 tracks/elixir/exercises/luhn/luhn_test.exs