| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- module TestCard exposing (..)
- import Card exposing (ManaCost(..), ManaColor(..))
- import Expect exposing (Expectation)
- import Fuzz exposing (Fuzzer, int, list, string)
- import Signals
- import Test exposing (..)
- suite : Test
- suite =
- describe "Card"
- [ test "parseManaCost ('')" <|
- \_ ->
- Expect.equal (Card.parseManaCost "") (Just [])
- , test "parseManaCost ('{X}')" <|
- \_ ->
- Expect.equal (Card.parseManaCost "{X}") (Just [ X ])
- , test "parseManaCost ('{X}{Y}')" <|
- \_ ->
- Expect.equal (Card.parseManaCost "{X}{Y}") (Just [ X, Y ])
- , test "parseManaCost ('{2/G}{2/U}{2/R}')" <|
- \_ ->
- Expect.equal (Card.parseManaCost "{2/G}{2/U}{2/R}") (Just [ TwoOrColor Green, TwoOrColor Blue, TwoOrColor Red ])
- , test "parsePower ('')" <|
- \_ ->
- Expect.equal (Card.parsePower "") Nothing
- , test "parsePower ('1')" <|
- \_ ->
- Expect.equal (Card.parsePower "1") (Just (Card.ConstantPower 1))
- , test "parsePower ('0')" <|
- \_ ->
- Expect.equal (Card.parsePower "0") (Just (Card.ConstantPower 0))
- , test "parsePower ('*')" <|
- \_ ->
- Expect.equal (Card.parsePower "*") (Just (Card.VariablePower))
- , test "parsePower ('1+*')" <|
- \_ ->
- Expect.equal (Card.parsePower "1+*") (Just (Card.ConstantPlusVariablePower 1))
- ]
|