import Graphics.Element exposing (Element)
import ElmTest exposing (elementRunner, suite, test, assertEqual)
import Date

--
a = {name = "Alice"}
b = {name = "Bob", supervisor = a}
c = {a | birthday = Date.fromString "1998-12-31"}

main : Element
main =
  elementRunner <| suite "Exploring records"
    [ test "one" <| .name a `assertEqual` "Alice"
    , test "two" <| .supervisor b `assertEqual` a
    ]

import ElmTest exposing (elementRunner, suite, defaultTest, assertEqual)
import List exposing (map)

boss = {name = "Alice", salary = 200000 }
worker = {name = "Bob", salary = 50000, supervisor = boss}
newWorker = {worker | name = "Carol" }

payrollTax : {a | salary : Float} -> Float
payrollTax {salary} =
  salary * 0.15

main =
  elementRunner <| suite "Exploring records" <| map defaultTest
    [ "Alice"  `assertEqual` .name boss
    , boss `assertEqual` worker.supervisor
    , 7500.0 `assertEqual` payrollTax worker
    , boss `assertEqual` newWorker.supervisor
    ]

Complete the intro record example in Elm
Complete the intro record example in Elm
