Hello community, here is the log from the commit of package ghc-interpolate for openSUSE:Factory checked in at 2017-08-31 20:47:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-interpolate (Old) and /work/SRC/openSUSE:Factory/.ghc-interpolate.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-interpolate" Thu Aug 31 20:47:57 2017 rev:3 rq:513403 version:0.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-interpolate/ghc-interpolate.changes 2017-06-22 10:38:00.617778130 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-interpolate.new/ghc-interpolate.changes 2017-08-31 20:47:57.967014553 +0200 @@ -1,0 +2,5 @@ +Thu Jul 27 14:05:24 UTC 2017 - [email protected] + +- Update to version 0.1.1. + +------------------------------------------------------------------- Old: ---- interpolate-0.1.0.tar.gz interpolate.cabal New: ---- interpolate-0.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-interpolate.spec ++++++ --- /var/tmp/diff_new_pack.4YbzDh/_old 2017-08-31 20:47:58.902883188 +0200 +++ /var/tmp/diff_new_pack.4YbzDh/_new 2017-08-31 20:47:58.906882626 +0200 @@ -19,14 +19,13 @@ %global pkg_name interpolate %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.1.0 +Version: 0.1.1 Release: 0 Summary: String interpolation done right License: MIT Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-haskell-src-meta-devel BuildRequires: ghc-rpm-macros @@ -56,7 +55,6 @@ %prep %setup -q -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ interpolate-0.1.0.tar.gz -> interpolate-0.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/LICENSE new/interpolate-0.1.1/LICENSE --- old/interpolate-0.1.0/LICENSE 2014-09-29 09:01:15.000000000 +0200 +++ new/interpolate-0.1.1/LICENSE 2017-05-31 05:51:32.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 2013 Simon Hengel <[email protected]> +Copyright (c) 2013-2015 Simon Hengel <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/interpolate.cabal new/interpolate-0.1.1/interpolate.cabal --- old/interpolate-0.1.0/interpolate.cabal 2014-09-29 09:01:15.000000000 +0200 +++ new/interpolate-0.1.1/interpolate.cabal 2017-05-31 05:51:32.000000000 +0200 @@ -1,12 +1,18 @@ +-- This file has been generated from package.yaml by hpack version 0.17.0. +-- +-- see: https://github.com/sol/hpack + name: interpolate -version: 0.1.0 +version: 0.1.1 +homepage: https://github.com/sol/interpolate#readme +bug-reports: https://github.com/sol/interpolate/issues license: MIT license-file: LICENSE -copyright: (c) 2013 Simon Hengel +copyright: (c) 2013-2015 Simon Hengel author: Simon Hengel <[email protected]> maintainer: Simon Hengel <[email protected]> build-type: Simple -cabal-version: >= 1.8 +cabal-version: >= 1.10 category: Data, Text stability: experimental synopsis: String interpolation done right @@ -17,8 +23,6 @@ location: https://github.com/sol/interpolate library - ghc-options: - -Wall hs-source-dirs: src exposed-modules: @@ -26,30 +30,43 @@ Data.String.Interpolate.IsString Data.String.Interpolate.Util other-modules: + Data.String.Interpolate.Compat Data.String.Interpolate.Internal.Util Data.String.Interpolate.Parse - Data.String.Interpolate.Compat + Paths_interpolate build-depends: - base == 4.* + base == 4.* , template-haskell - , haskell-src-meta + , haskell-src-meta >= 0.8 + ghc-options: -Wall + default-language: Haskell2010 test-suite spec - type: - exitcode-stdio-1.0 - ghc-options: - -Wall + type: exitcode-stdio-1.0 hs-source-dirs: - src, test - main-is: - Spec.hs + src + test + main-is: Spec.hs + other-modules: + Data.String.Interpolate + Data.String.Interpolate.Compat + Data.String.Interpolate.Internal.Util + Data.String.Interpolate.IsString + Data.String.Interpolate.Parse + Data.String.Interpolate.Util + Data.String.Interpolate.Internal.UtilSpec + Data.String.Interpolate.IsStringSpec + Data.String.Interpolate.ParseSpec + Data.String.Interpolate.UtilSpec + Data.String.InterpolateSpec build-depends: - base == 4.* + base == 4.* , template-haskell - , haskell-src-meta - + , haskell-src-meta >= 0.8 , text , bytestring , hspec >= 1.5 , QuickCheck , quickcheck-instances + ghc-options: -Wall + default-language: Haskell2010 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/src/Data/String/Interpolate.hs new/interpolate-0.1.1/src/Data/String/Interpolate.hs --- old/interpolate-0.1.0/src/Data/String/Interpolate.hs 2014-09-29 09:01:15.000000000 +0200 +++ new/interpolate-0.1.1/src/Data/String/Interpolate.hs 2017-05-31 05:51:32.000000000 +0200 @@ -11,7 +11,7 @@ ) where import Language.Haskell.TH.Quote (QuasiQuoter(..)) -import Language.Haskell.Meta.Parse.Careful (parseExp) +import Language.Haskell.Meta.Parse (parseExp) import Data.String.Interpolate.Internal.Util import Data.String.Interpolate.Parse diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/Interpolate/Internal/UtilSpec.hs new/interpolate-0.1.1/test/Data/String/Interpolate/Internal/UtilSpec.hs --- old/interpolate-0.1.0/test/Data/String/Interpolate/Internal/UtilSpec.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/interpolate-0.1.1/test/Data/String/Interpolate/Internal/UtilSpec.hs 2017-05-31 05:51:32.000000000 +0200 @@ -0,0 +1,84 @@ +{-# LANGUAGE CPP #-} +module Data.String.Interpolate.Internal.UtilSpec where + +import Test.Hspec +import Test.QuickCheck +import Test.QuickCheck.Instances () + +import qualified Data.Text as T +import qualified Data.Text.Lazy as LT +import qualified Data.ByteString.Char8 as B +import qualified Data.ByteString.Lazy.Char8 as LB + +import Data.String.Interpolate.Internal.Util + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "toString" $ do + it "behaves like `show`" $ do + property $ \n -> toString (n :: Int) `shouldBe` show n + + context "when used with String" $ do + it "behaves like `id`" $ do + property $ \s -> toString s `shouldBe` s + + context "when used with Text" $ do + it "behaves like `unpack`" $ do + property $ \s -> toString s `shouldBe` T.unpack s + + context "when used with lazy Text" $ do + it "behaves like `unpack`" $ do + property $ \s -> toString s `shouldBe` LT.unpack s + + context "when used with ByteString" $ do + it "behaves like `unpack`" $ do + property $ \s -> toString s `shouldBe` B.unpack s + + context "when used with lazy ByteString" $ do + it "behaves like `unpack`" $ do + property $ \s -> do +#if __GLASGOW_HASKELL__ < 706 + pendingWith "Does not work with GHC < 7.6" +#endif + toString s `shouldBe` LB.unpack s + + describe "unescape" $ do + it "unescapes single-character escape codes" $ do + unescape "\\n" `shouldBe` "\n" + + it "unescapes ASCII control code abbreviations" $ do + unescape "\\BEL" `shouldBe` "\BEL" + + it "unescapes decimal character literals" $ do + unescape "\\955" `shouldBe` "\955" + + it "unescapes hexadecimal character literals" $ do + unescape "\\xbeef" `shouldBe` "\xbeef" + + it "unescapes octal character literals" $ do + unescape "\\o1234" `shouldBe` "\o1234" + + context "with control escape sequences" $ do + it "unescapes null character" $ do + unescape "\\^@" `shouldBe` "\^@" + + it "unescapes control codes" $ do + unescape "\\^A" `shouldBe` "\^A" + + it "unescapes escape" $ do + unescape "\\^[" `shouldBe` "\^[" + + it "unescapes file separator" $ do + unescape "\\^\\ x" `shouldBe` "\^\ x" + + it "unescapes group separator" $ do + unescape "\\^]" `shouldBe` "\^]" + + it "unescapes record separator" $ do + unescape "\\^^" `shouldBe` "\^^" + + it "unescapes unit separator" $ do + unescape "\\^_" `shouldBe` "\^_" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/Interpolate/IsStringSpec.hs new/interpolate-0.1.1/test/Data/String/Interpolate/IsStringSpec.hs --- old/interpolate-0.1.0/test/Data/String/Interpolate/IsStringSpec.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/interpolate-0.1.1/test/Data/String/Interpolate/IsStringSpec.hs 2017-05-31 05:51:32.000000000 +0200 @@ -0,0 +1,19 @@ +{-# LANGUAGE QuasiQuotes #-} +module Data.String.Interpolate.IsStringSpec (main, spec) where + +import Test.Hspec + +import qualified Data.Text as T +import Data.String.Interpolate.IsString + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "[i|...|]" $ do + it "can be used to construct String literals" $ do + [i|foo #{23 :: Int} bar|] `shouldBe` "foo 23 bar" + + it "can be used to construct Text literals" $ do + [i|foo #{23 :: Int} bar|] `shouldBe` T.pack "foo 23 bar" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/Interpolate/ParseSpec.hs new/interpolate-0.1.1/test/Data/String/Interpolate/ParseSpec.hs --- old/interpolate-0.1.0/test/Data/String/Interpolate/ParseSpec.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/interpolate-0.1.1/test/Data/String/Interpolate/ParseSpec.hs 2017-05-31 05:51:32.000000000 +0200 @@ -0,0 +1,26 @@ +{-# LANGUAGE StandaloneDeriving #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +module Data.String.Interpolate.ParseSpec (main, spec) where + +import Test.Hspec + +import Data.String.Interpolate.Parse + +deriving instance Eq Node +deriving instance Show Node + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "parseNodes" $ do + it "parses string literals" $ do + parseNodes "foo" `shouldBe` [Literal "foo"] + + it "parses embedded expressions" $ do + parseNodes "foo #{bar} baz" `shouldBe` [Literal "foo ", Expression "bar", Literal " baz"] + + context "when given an unterminated expression" $ do + it "parses it as a string literal" $ do + parseNodes "foo #{bar" `shouldBe` [Literal "foo #{bar"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/Interpolate/UtilSpec.hs new/interpolate-0.1.1/test/Data/String/Interpolate/UtilSpec.hs --- old/interpolate-0.1.0/test/Data/String/Interpolate/UtilSpec.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/interpolate-0.1.1/test/Data/String/Interpolate/UtilSpec.hs 2017-05-31 05:51:32.000000000 +0200 @@ -0,0 +1,55 @@ +module Data.String.Interpolate.UtilSpec (main, spec) where + +import Test.Hspec +import Test.QuickCheck +import Control.Applicative + +import Data.String.Interpolate.Util + +main :: IO () +main = hspec spec + +emptyLine :: Gen String +emptyLine = (++ "\n") <$> listOf (elements " \t") + +spec :: Spec +spec = do + describe "unindent" $ do + it "removes indentation" $ do + let xs = " foo\n bar\n baz \n" + unindent xs `shouldBe` " foo\nbar\n baz \n" + + it "removes the first line of the string if it is empty" $ do + forAll emptyLine $ \xs -> do + let ys = " foo\nbar\n baz\n" + unindent (xs ++ ys) `shouldBe` ys + + it "does not affect additional empty lines at the beginning" $ do + unindent " \n \nfoo" `shouldBe` " \nfoo" + + it "empties the last line if it only consists of spaces" $ do + let xs = "foo\n " + unindent xs `shouldBe` "foo\n" + + it "does not affect other whitespace lines at the end" $ do + unindent "foo\n \n " `shouldBe` "foo\n \n" + + it "disregards empty lines when calculating indentation" $ do + let xs = " foo\n\n \n bar\n" + unindent xs `shouldBe` "foo\n\n\nbar\n" + + it "correctly handles strings that do not end with a newline" $ do + let xs = "foo" + unindent xs `shouldBe` xs + + it "does not affect lines consisting of whitespace (apart from unindenting)" $ do + unindent " foo\n \n bar" `shouldBe` "foo\n \nbar" + + it "is total" $ do + property $ \xs -> length (unindent xs) `shouldSatisfy` (>= 0) + + context "when all lines are empty" $ do + it "does not unindent at all" $ do + forAll emptyLine $ \x -> (forAll $ listOf emptyLine) $ \xs -> do + let ys = concat xs + unindent (x ++ ys) `shouldBe` ys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/InterpolateSpec.hs new/interpolate-0.1.1/test/Data/String/InterpolateSpec.hs --- old/interpolate-0.1.0/test/Data/String/InterpolateSpec.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/interpolate-0.1.1/test/Data/String/InterpolateSpec.hs 2017-05-31 05:51:32.000000000 +0200 @@ -0,0 +1,34 @@ +{-# LANGUAGE QuasiQuotes #-} +module Data.String.InterpolateSpec (main, spec) where + +import Test.Hspec +import Test.QuickCheck + +import Data.String.Interpolate + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "[i|...|]" $ do + it "interpolates an expression of type Int" $ do + property $ \x y -> [i|foo #{x + y :: Int} bar|] `shouldBe` "foo " ++ show (x + y) ++ " bar" + + it "interpolates an expression of type String" $ do + property $ \xs ys -> [i|foo #{xs ++ ys} bar|] `shouldBe` "foo " ++ xs ++ ys ++ " bar" + + it "accepts character escapes" $ do + [i|foo \955 bar|] `shouldBe` "foo \955 bar" + + it "accepts character escapes in interpolated expressions" $ do + [i|foo #{"\955" :: String} bar|] `shouldBe` "foo \955 bar" + + it "dose not strip backslashes (issue #1)" $ do + [i|foo\\bar|] `shouldBe` "foo\\bar" + + it "allows to prevent interpolation by escaping the hash with a backslash" $ do + [i|foo \#{23 :: Int} bar|] `shouldBe` "foo #{23 :: Int} bar" + + it "does not prevent interpolation on literal backslash" $ do + [i|foo \\#{23 :: Int} bar|] `shouldBe` "foo \\23 bar"
