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.1.0.28 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.27 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.26 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.25 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.24 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.23 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.22 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.21 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.20 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.19 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.18 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.17 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.16 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.15 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.14 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.13 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.12 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.11 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.10 tracks/elixir/exercises/luhn/luhn_test.exs
trackler-2.1.0.9 tracks/elixir/exercises/luhn/luhn_test.exs