1{-# LANGUAGE OverloadedStrings #-}
2
3module CodeAction.IntroDestructSpec where
4
5import Wingman.Types
6import Test.Hspec
7import Utils
8
9
10spec :: Spec
11spec = do
12  let test l c = goldenTest IntroAndDestruct "" l c
13               . mappend "IntroDestruct"
14
15  describe "golden" $ do
16    test 4  5 "One"
17    test 2  5 "Many"
18    test 4 11 "LetBinding"
19
20  describe "provider" $ do
21    mkTest
22      "Can intro and destruct an algebraic ty"
23      "IntroDestructProvider" 2 12
24      [ (id, IntroAndDestruct, "")
25      ]
26    mkTest
27      "Won't intro and destruct a non-algebraic ty"
28      "IntroDestructProvider" 5 12
29      [ (not, IntroAndDestruct, "")
30      ]
31    mkTest
32      "Can't intro, so no option"
33      "IntroDestructProvider" 8 17
34      [ (not, IntroAndDestruct, "")
35      ]
36
37