lexerTests :: TestTree
lexerTests = testGroup "Lexer tests"
  [ testCase "123 is an integer number" $
    parseSexp' "123" @?= Right (Int' 123)
  , testCase "+123 is an integer number" $
    parseSexp' "+123" @?= Right (Int' 123)
  , testCase "-123 is an integer number" $
    parseSexp' "-123" @?= Right (Int' (- 123))
  , testCase "+123.4e5 is a floating number" $
    parseSexp' "+123.4e5" @?= Right (Real' (read "+123.4e5" :: Scientific))
  , testCase "comments" $
    parseSexp' ";; hello, world\n   123" @?= Right (Int' 123)
  , testCase "cyrillic characters in comments" $
    parseSexp' ";; привет!\n   123" @?= Right (Int' 123)
  , testCase "unicode math in comments" $
    parseSexp' ";; Γ ctx\n;; ----- Nat-formation\n;; Γ ⊦ Nat : Type\nfoobar" @?=
      Right (Symbol' "foobar")
  , testCase "symbol" $
    parseSexp' "hello-world" @?= Right (Symbol' "hello-world")
  , testCase "cyrillic symbol" $
    parseSexp' "привет-мир" @?= Right (Symbol' "привет-мир")
  , testCase "string with arabic characters" $
    parseSexp' "\"ي الخاطفة الجديدة، مع, بلديهم\"" @?=
    Right (String' "ي الخاطفة الجديدة، مع, بلديهم")
  , testCase "string with japanese characters" $
    parseSexp' "\"媯綩 づ竤バ り姥娩ぎょひ\"" @?=
    Right (String' "媯綩 づ竤バ り姥娩ぎょひ")
  ]

grammarTests :: TestTree
grammarTests = testGroup "Grammar tests"
  [ baseTypeTests
  , listTests
  , revStackPrismTes
lexerTests :: TestTree
lexerTests = testGroup "Lexer tests"
  [ testCase "123 is an integer number" $
    parseSexp' "123" @?= Right (Int' 123)
  , testCase "+123 is an integer number" $
    parseSexp' "+123" @?= Right (Int' 123)
  , testCase "-123 is an integer number" $
    parseSexp' "-123" @?= Right (Int' (- 123))
  , testCase "+123.4e5 is a floating number" $
    parseSexp' "+123.4e5" @?= Right (Real' (read "+123.4e5" :: Scientific))
  , testCase "comments" $
    parseSexp' ";; hello, world\n   123" @?= Right (Int' 123)
  , testCase "cyrillic characters in comments" $
    parseSexp' ";; привет!\n   123" @?= Right (Int' 123)
  , testCase "unicode math in comments" $
    parseSexp' ";; Γ ctx\n;; ----- Nat-formation\n;; Γ ⊦ Nat : Type\nfoobar" @?=
      Right (Symbol' "foobar")
  , testCase "symbol" $
    parseSexp' "hello-world" @?= Right (Symbol' "hello-world")
  , testCase "cyrillic symbol" $
    parseSexp' "привет-мир" @?= Right (Symbol' "привет-мир")
  , testCase "string with arabic characters" $
    parseSexp' "\"ي الخاطفة الجديدة، مع, بلديهم\"" @?=
    Right (String' "ي الخاطفة الجديدة، مع, بلديهم")
  , testCase "string with japanese characters" $
    parseSexp' "\"媯綩 づ竤バ り姥娩ぎょひ\"" @?=
    Right (String' "媯綩 づ竤バ り姥娩ぎょひ")
  ]
lexerTests = testGroup "Lexer tests"
  [ testCase "123 is an integer number" $
    parseSexp' "123" @?= Right (Int' 123)
  , testCase "+123 is an integer number" $
    parseSexp' "+123" @?= Right (Int' 123)
  , testCase "-123 is an integer number" $
    parseSexp' "-123" @?= Right (Int' (- 123))
  , testCase "+123.4e5 is a floating number" $
    parseSexp' "+123.4e5" @?= Right (Real' (read "+123.4e5" :: Scientific))
  , testCase "comments" $
    parseSexp' ";; hello, world\n   123" @?= Right (Int' 123)
  , testCase "cyrillic characters in comments" $
    parseSexp' ";; привет!\n   123" @?= Right (Int' 123)
  , testCase "unicode math in comments" $
    parseSexp' ";; Γ ctx\n;; ----- Nat-formation\n;; Γ ⊦ Nat : Type\nfoobar" @?=
      Right (Symbol' "foobar")
  , testCase "symbol" $
    parseSexp' "hello-world" @?= Right (Symbol' "hello-world")
  , testCase "cyrillic symbol" $
    parseSexp' "привет-мир" @?= Right (Symbol' "привет-мир")
  , testCase "string with arabic characters" $
    parseSexp' "\"ي الخاطفة الجديدة، مع, بلديهم\"" @?=
    Right (String' "ي الخاطفة الجديدة، مع, بلديهم")
  , testCase "string with japanese characters" $
    parseSexp' "\"媯綩 づ竤バ り姥娩ぎょひ\"" @?=
    Right (String' "媯綩 づ竤バ り姥娩ぎょひ")
  ]