File: PrimaryTests.hs

package info (click to toggle)
haskell-hslua-core 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 288 kB
  • sloc: haskell: 2,243; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 692 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{-# LANGUAGE OverloadedStrings #-}
{-| Tests for the primary library.
-}
module HsLua.Core.PrimaryTests (tests) where

import HsLua.Core
import Test.Tasty.HsLua ((=:), shouldBeResultOf)
import Test.Tasty (TestTree, testGroup)

-- | Specifications for Attributes parsing functions.
tests :: TestTree
tests = testGroup "Primary"
  [ testGroup "rotate'"
    [ "rotates stack" =:
    (Just 2, Just 1, Just 4, Just 3) `shouldBeResultOf` do
        pushnumber 4
        pushnumber 3
        pushnumber 2
        pushnumber 1
        rotate (nth 4) 2
        (,,,)
          <$> tonumber (nth 4)
          <*> tonumber (nth 3)
          <*> tonumber (nth 2)
          <*> tonumber (nth 1)
    ]
  ]