myst-lang / myst

A structured, dynamic, general-purpose language.
http://myst-lang.org
MIT License
119 stars 17 forks source link

[Stdlib, Spec-lib] Myst spec failures now includes path to the failure #161

Closed Jens0512 closed 6 years ago

Jens0512 commented 6 years ago

This completes #139 and #141

require "stdlib/spec.mt"

describe("Fish") do
  describe("#swim") do
    it("moves the fish forward")do
      assert(false)
    end
  end
end

Will now print:


  Fish #swim moves the fish forward
    Assertion failed.
    Expected: true
         Got: false

In red :D

Also with this came a simple module Color with #colored which is what is used for printing red and green stuff here. To make that work, I added some lexing for escape codes (notably \e).

faultyserver commented 6 years ago

This is awesome stuff! I'm excited to get this in and be able to use it :)

faultyserver commented 6 years ago

Looks good! Thanks for all of this :)