-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 967: Use unsafeDupablePerformIO in unsafePackLenLiteral
- Loading branch information
Showing
5 changed files
with
46 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{-# LANGUAGE Strict #-} | ||
{-# LANGUAGE TemplateHaskell #-} | ||
-- {-# OPTIONS_GHC -ddump-splices #-} | ||
-- {-# OPTIONS_GHC -ddump-simpl -ddump-to-file #-} | ||
module Regression.Issue967 (issue967) where | ||
|
||
import Test.Tasty (TestTree) | ||
import Test.Tasty.HUnit (testCase, assertEqual) | ||
|
||
import qualified Data.Text.Lazy as LT | ||
import qualified Data.Text.Lazy.Encoding as LTE | ||
|
||
import Data.Aeson | ||
import Data.Aeson.TH | ||
|
||
data DataA = DataA | ||
{ val1 :: Int, | ||
val2 :: Int | ||
} | ||
deriving (Eq, Show) | ||
|
||
------------------------------------------------------------------------------- | ||
-- Instances | ||
------------------------------------------------------------------------------- | ||
|
||
$(deriveJSON defaultOptions ''DataA) | ||
|
||
------------------------------------------------------------------------------- | ||
-- Test | ||
------------------------------------------------------------------------------- | ||
|
||
issue967 :: TestTree | ||
issue967 = testCase "issue967" $ do | ||
let ev = DataA 1 2 | ||
encoding = encode ev | ||
parsedEv = decode encoding :: Maybe DataA | ||
|
||
assertEqual (LT.unpack $ LTE.decodeUtf8 encoding) (Just ev) parsedEv |
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