-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
temp: fix isOurAddress and add test project
- Loading branch information
1 parent
9832e14
commit 10f8898
Showing
6 changed files
with
91 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
module ProfileWalletSpec () where | ||
|
||
import Test.Hspec | ||
import Test.QuickCheck | ||
import Control.Exception (evaluate) | ||
import Plutus.Certification.ProfileWallet | ||
import Control.Monad (forM, forM_) | ||
import Data.Text | ||
|
||
{- | ||
mainAddress :: Text | ||
mainAddress = "addr_test1qphgqts20fhx0yx7ug42xehcnryukchy5k7hpaksgxax2fzt5w2gu33s8wrw3c9tjs97dr5pulsvf39e56v7c9ar39asptcrtp" | ||
spec = | ||
describe "Wallet address" $ do | ||
forM_ ["addr_test1qql086jk0tlggvk6yxdkndsusk5ukp799spddm9kv4mmlzjt5w2gu33s8wrw3c9tjs97dr5pulsvf39e56v7c9ar39asqf3an7"] | ||
$ \addr -> do | ||
it "returns the first element of a list" $ | ||
sameWallet mainAddress addr `shouldBe` True | ||
-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Test.Hspec | ||
import Test.QuickCheck | ||
import Control.Exception (evaluate) | ||
--import qualified ProfileWalletSpec as ProfileWallet | ||
|
||
main :: IO () | ||
main = hspec $ do | ||
describe "Prelude.head" $ do | ||
it "returns the first element of a list" $ do | ||
head [23 ..] `shouldBe` (23 :: Int) | ||
|
||
it "returns the first element of an *arbitrary* list" $ | ||
property $ \x xs -> head (x:xs) == (x :: Int) | ||
|
||
it "throws an exception if used with an empty list" $ do | ||
evaluate (head []) `shouldThrow` anyException | ||
--ProfileWallet.spec |