union TrafficLight { Stop Go Caution }

: is-stop? ( TrafficLight -- Bool )
    match
        Stop -> true
        Go -> false
        Caution -> false
    end
;

: is-go? ( TrafficLight -- Bool )
    match
        Stop -> false
        Go -> true
        Caution -> false
    end
;

: test-create-stop ( -- )
    Make-Stop is-stop?
    test.assert
;

: test-create-go ( -- )
    Make-Go is-go?
    test.assert
;

: test-stop-not-go ( -- )
    Make-Stop is-go?
    not test.assert
;
