Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Api.TypesSpec: Make test case names shorter
  • Loading branch information
rvl committed Sep 13, 2021
1 parent 804346f commit e3f161b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
12 changes: 4 additions & 8 deletions lib/core/test/unit/Cardano/Wallet/Api/TypesSpec.hs
Expand Up @@ -438,9 +438,7 @@ spec = parallel $ do
let jsonRoundtripAndGolden = Utils.jsonRoundtripAndGolden
($(getTestData) </> "Cardano" </> "Wallet" </> "Api")

parallel $ describe
"can perform roundtrip JSON serialization & deserialization, \
\and match existing golden files" $ do
describe "JSON golden roundtrip" $ do
jsonRoundtripAndGolden $ Proxy @AnyAddress
jsonRoundtripAndGolden $ Proxy @ApiCredential
jsonRoundtripAndGolden $ Proxy @ApiAddressData
Expand Down Expand Up @@ -544,8 +542,7 @@ spec = parallel $ do
jsonRoundtripAndGolden $ Proxy @ApiNullStakeKey
jsonRoundtripAndGolden $ Proxy @(PostMintBurnAssetData ('Testnet 0))

describe "Textual encoding" $ do
describe "Can perform roundtrip textual encoding & decoding" $ do
describe "ToText-FromText Roundtrip" $ do
textRoundtrip $ Proxy @Iso8601Time
textRoundtrip $ Proxy @SortOrder
textRoundtrip $ Proxy @Coin
Expand All @@ -560,8 +557,7 @@ spec = parallel $ do
fromText @(AddressAmount Text) "22323"
=== Left (TextDecodingError err)

describe
"can perform roundtrip HttpApiData serialization & deserialization" $ do
describe "HttpApiData roundtrip" $ do
httpApiDataRoundtrip $ Proxy @(ApiT WalletId)
httpApiDataRoundtrip $ Proxy @(ApiT AddressState)
httpApiDataRoundtrip $ Proxy @Iso8601Time
Expand Down Expand Up @@ -589,7 +585,7 @@ spec = parallel $ do
\existing path in the specification" $
validateEveryPath (Proxy :: Proxy (Api ('Testnet 0) ApiStakePool))

parallel $ describe "verify JSON parsing failures too" $ do
describe "verify JSON parsing failures too" $ do
it "ApiT (Passphrase \"raw\") (too short)" $ do
let minLength = passphraseMinLength (Proxy :: Proxy "raw")
let msg = "Error in $: passphrase is too short: \
Expand Down
8 changes: 2 additions & 6 deletions lib/text-class/src/Test/Text/Roundtrip.hs
Expand Up @@ -24,9 +24,5 @@ textRoundtrip
:: forall a. (Arbitrary a, Eq a, Show a, ToText a, FromText a, Typeable a)
=> Proxy a
-> Spec
textRoundtrip proxy = it
("can perform roundtrip textual encoding and decoding for values of type '"
<> show (typeRep proxy)
<> "'")
(property $ \a ->
fromText (toText @a a) === Right a)
textRoundtrip proxy = it (show (typeRep proxy)) $
property $ \a -> fromText (toText @a a) === Right a

0 comments on commit e3f161b

Please sign in to comment.