From 5a9cdd3cc89507d4d74f8bded56ce5e037b3b56e Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 23 Feb 2024 07:08:18 +0100 Subject: wip --- .../apps/processquest-1.0.0/test/pq_market_tests.erl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl (limited to 'learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl') diff --git a/learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl b/learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl new file mode 100644 index 0000000..d689f67 --- /dev/null +++ b/learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl @@ -0,0 +1,15 @@ +-module(pq_market_tests). +-include_lib("eunit/include/eunit.hrl"). + +best_smallest_weapon_test_() -> + [?_assertMatch({<<"plastic knife">>, 0, 1, 3}, pq_market:weapon(0, 5)), + ?_assertMatch({<<"plastic knife">>, 1, 1, 5}, pq_market:weapon(1, 100)), + ?_assertMatch(undefined, pq_market:weapon(0,0)), + ?_assertMatch(undefined, pq_market:weapon(50000,100000000000000000000))]. + +best_smallest_gear_test_() -> + [[?_assertMatch({<<"wool">>, 0, 1, 25}, pq_market:F(0, 35)), + ?_assertMatch({<<"pleather">>, 0, 2, 45}, pq_market:F(1, 100)), + ?_assertMatch(undefined, pq_market:F(0,0)), + ?_assertMatch(undefined, pq_market:F(50000,100000000000000000000))] + || F <- [helmet, shield, armor]]. -- cgit v1.2.3