Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-hslua-marshalling for
openSUSE:Factory checked in at 2023-04-14 13:13:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hslua-marshalling (Old)
and /work/SRC/openSUSE:Factory/.ghc-hslua-marshalling.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hslua-marshalling"
Fri Apr 14 13:13:01 2023 rev:5 rq:1079184 version:2.3.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-hslua-marshalling/ghc-hslua-marshalling.changes
2023-04-04 21:20:44.029303489 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-hslua-marshalling.new.19717/ghc-hslua-marshalling.changes
2023-04-14 13:13:11.631603569 +0200
@@ -1,0 +2,16 @@
+Thu Apr 13 12:06:19 UTC 2023 - Peter Simons <[email protected]>
+
+- Update hslua-marshalling to version 2.3.0.
+ ## hslua-marshalling-2.3.0
+
+ Released 2023-03-13.
+
+ - `Result` is now an instance of `MonadFail`.
+
+ - New peeker and pusher functions for `NonEmpty`.
+
+ - Peeker combinators for optional values: The new combinators
+ `peekNilOr`, `peekNoneOr`, and `peekNoneOrNil` can be used to
+ retrieve optional values.
+
+-------------------------------------------------------------------
Old:
----
hslua-marshalling-2.2.1.tar.gz
New:
----
hslua-marshalling-2.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hslua-marshalling.spec ++++++
--- /var/tmp/diff_new_pack.bSYbSI/_old 2023-04-14 13:13:12.103606268 +0200
+++ /var/tmp/diff_new_pack.bSYbSI/_new 2023-04-14 13:13:12.131606428 +0200
@@ -20,7 +20,7 @@
%global pkgver %{pkg_name}-%{version}
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 2.2.1
+Version: 2.3.0
Release: 0
Summary: Marshalling of values between Haskell and Lua
License: MIT
++++++ hslua-marshalling-2.2.1.tar.gz -> hslua-marshalling-2.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-marshalling-2.2.1/CHANGELOG.md
new/hslua-marshalling-2.3.0/CHANGELOG.md
--- old/hslua-marshalling-2.2.1/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
+++ new/hslua-marshalling-2.3.0/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
@@ -2,6 +2,18 @@
`hslua-marshalling` uses [PVP Versioning][].
+## hslua-marshalling-2.3.0
+
+Released 2023-03-13.
+
+- `Result` is now an instance of `MonadFail`.
+
+- New peeker and pusher functions for `NonEmpty`.
+
+- Peeker combinators for optional values: The new combinators
+ `peekNilOr`, `peekNoneOr`, and `peekNoneOrNil` can be used to
+ retrieve optional values.
+
## hslua-marshalling-2.2.1
Released 2022-06-19.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-marshalling-2.2.1/LICENSE
new/hslua-marshalling-2.3.0/LICENSE
--- old/hslua-marshalling-2.2.1/LICENSE 2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/LICENSE 2001-09-09 03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
Copyright © 1994-2022 Lua.org, PUC-Rio.
Copyright © 2007-2012 Gracjan Polak
Copyright © 2012-2015 Ãmer Sinan AÄacan
-Copyright © 2016-2022 Albert Krewinkel
+Copyright © 2016-2023 Albert Krewinkel
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-marshalling-2.2.1/hslua-marshalling.cabal
new/hslua-marshalling-2.3.0/hslua-marshalling.cabal
--- old/hslua-marshalling-2.2.1/hslua-marshalling.cabal 2001-09-09
03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/hslua-marshalling.cabal 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: hslua-marshalling
-version: 2.2.1
+version: 2.3.0
synopsis: Marshalling of values between Haskell and Lua.
description: Provides functions to marshal values from Haskell
to Lua, and /vice versa/.
@@ -13,21 +13,20 @@
license: MIT
license-file: LICENSE
author: Albert Krewinkel, Gracjan Polak, Ãmer Sinan AÄacan
-maintainer: [email protected]
+maintainer: [email protected]
copyright: © 2007â2012 Gracjan Polak;
© 2012â2016 Ãmer Sinan AÄacan;
- © 2017-2022 Albert Krewinkel
+ © 2017-2023 Albert Krewinkel
category: Foreign
extra-source-files: README.md
, CHANGELOG.md
-tested-with: GHC == 8.0.2
- , GHC == 8.2.2
- , GHC == 8.4.4
+tested-with: GHC == 8.4.4
, GHC == 8.6.5
, GHC == 8.8.4
, GHC == 8.10.7
, GHC == 9.0.2
- , GHC == 9.2.3
+ , GHC == 9.2.5
+ , GHC == 9.4.4
source-repository head
type: git
@@ -36,10 +35,10 @@
common common-options
default-language: Haskell2010
- build-depends: base >= 4.8 && < 5
+ build-depends: base >= 4.11 && < 5
, bytestring >= 0.10.2 && < 0.12
, containers >= 0.5.9 && < 0.7
- , hslua-core >= 2.2.1 && < 2.3
+ , hslua-core >= 2.2.1 && < 2.4
, mtl >= 2.2 && < 2.4
, text >= 1.2 && < 2.1
ghc-options: -Wall
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/src/HsLua/Marshalling/Peek.hs
new/hslua-marshalling-2.3.0/src/HsLua/Marshalling/Peek.hs
--- old/hslua-marshalling-2.2.1/src/HsLua/Marshalling/Peek.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/src/HsLua/Marshalling/Peek.hs 2001-09-09
03:46:40.000000000 +0200
@@ -4,9 +4,9 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-|
Module : HsLua.Marshalling.Peek
-Copyright : © 2020-2022 Albert Krewinkel
+Copyright : © 2020-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Stability : beta
Portability : Portable
@@ -40,9 +40,6 @@
#if !MIN_VERSION_base(4,13,0)
import Control.Monad.Fail (MonadFail (..))
#endif
-#if !MIN_VERSION_base(4,12,0)
-import Data.Semigroup (Semigroup ((<>)))
-#endif
import qualified HsLua.Core.Utf8 as Utf8
-- | Record to keep track of failure contexts while retrieving objects
@@ -73,6 +70,10 @@
instance MonadPlus Result
+instance MonadFail Result where
+ fail = failure . Utf8.fromString
+ {-# INLINABLE fail #-}
+
--
-- Peek
--
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/src/HsLua/Marshalling/Peekers.hs
new/hslua-marshalling-2.3.0/src/HsLua/Marshalling/Peekers.hs
--- old/hslua-marshalling-2.2.1/src/HsLua/Marshalling/Peekers.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/src/HsLua/Marshalling/Peekers.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,12 +1,11 @@
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-|
Module : HsLua.Marshalling.Peekers
-Copyright : © 2020-2022 Albert Krewinkel
+Copyright : © 2020-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Stability : beta
Portability : Portable
@@ -32,12 +31,16 @@
-- ** Collections
, peekKeyValuePairs
, peekList
+ , peekNonEmpty
, peekMap
, peekSet
-- ** Combinators
, choice
, peekFieldRaw
, peekIndexRaw
+ , peekNilOr
+ , peekNoneOr
+ , peekNoneOrNilOr
, peekPair
, peekTriple
-- ** Building peek functions
@@ -49,6 +52,7 @@
import Control.Applicative (Alternative (..))
import Control.Monad ((<$!>), (>=>), void)
import Data.ByteString (ByteString)
+import Data.List.NonEmpty (NonEmpty ((:|)))
import Data.Map (Map)
import Data.Set (Set)
import Data.String (IsString (fromString))
@@ -56,10 +60,6 @@
import HsLua.Marshalling.Peek
import Text.Read (readMaybe)
-#if !MIN_VERSION_base(4,12,0)
-import Data.Semigroup (Semigroup ((<>)))
-#endif
-
import qualified Data.ByteString.Lazy as BL
import qualified Data.Map as Map
import qualified Data.Set as Set
@@ -226,8 +226,18 @@
-- the list is equal to @rawlen(t)@. The operation will fail unless all
-- numerical fields between @1@ and @rawlen(t)@ can be retrieved.
peekList :: forall a e. LuaError e => Peeker e a -> Peeker e [a]
-peekList peekElement = fmap (retrieving "list") .
- typeChecked "table" istable $ \idx -> do
+peekList peekElement = retrieving "list" . peekList' peekElement
+
+-- | Like 'peekList', but fails if the list is empty.
+peekNonEmpty :: LuaError e => Peeker e a -> Peeker e (NonEmpty a)
+peekNonEmpty peekElement = retrieving "NonEmpty" .
+ (peekList' peekElement >=> \case
+ (x:xs) -> return (x :| xs)
+ [] -> failPeek "empty list")
+
+-- | Helper function that retrieves a list, but doesn't set a context.
+peekList' :: LuaError e => Peeker e a -> Peeker e [a]
+peekList' peekElement = typeChecked "table" istable $ \idx -> do
liftLua $ checkstack' 1 "retrieving a list"
let elementsAt [] = return []
elementsAt (i : is) = do
@@ -310,6 +320,35 @@
peeker top `lastly` Lua.pop 1
{-# INLINABLE peekIndexRaw #-}
+
+-- | Returns 'empty' if the value at the given index is @nil@;
+-- otherwise returns the result of peeker @p@.
+peekNilOr :: Alternative m
+ => Peeker e a -- ^ p
+ -> Peeker e (m a)
+peekNilOr p idx = liftLua (ltype idx) >>= \case
+ TypeNil -> pure empty
+ _ -> pure <$> p idx
+
+-- | Returns 'empty' if the value at the given index is @none@;
+-- otherwise returns the result of peeker @p@.
+peekNoneOr :: Alternative m
+ => Peeker e a -- ^ p
+ -> Peeker e (m a)
+peekNoneOr p idx = liftLua (ltype idx) >>= \case
+ TypeNone -> pure empty
+ _ -> pure <$> p idx
+
+-- | Returns 'empty' if the value at the given index is @none@ or
+-- @nil@; otherwise returns the result of peeker @p@.
+peekNoneOrNilOr :: Alternative m
+ => Peeker e a -- ^ p
+ -> Peeker e (m a)
+peekNoneOrNilOr p idx = liftLua (ltype idx) >>= \case
+ TypeNil -> pure empty
+ TypeNone -> pure empty
+ _ -> pure <$> p idx
+
-- | Retrieves a value pair from a table. Expects the values to be
-- stored in a numerically indexed table; does not access metamethods.
peekPair :: LuaError e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/src/HsLua/Marshalling/Push.hs
new/hslua-marshalling-2.3.0/src/HsLua/Marshalling/Push.hs
--- old/hslua-marshalling-2.2.1/src/HsLua/Marshalling/Push.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/src/HsLua/Marshalling/Push.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,8 +1,8 @@
{-|
Module : HsLua.Marshalling.Push
-Copyright : © 2020-2022 Albert Krewinkel
+Copyright : © 2020-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Stability : beta
Portability : Portable
@@ -22,6 +22,7 @@
, pushName
-- * Collections
, pushList
+ , pushNonEmpty
, pushKeyValuePairs
, pushMap
, pushSet
@@ -40,6 +41,7 @@
import qualified Data.Text as T
import qualified Data.ByteString.Lazy as BL
+import qualified Data.List.NonEmpty as NonEmpty
import qualified HsLua.Core.Utf8 as Utf8
-- | Function to push a value to Lua's stack.
@@ -114,6 +116,10 @@
newtable
zipWithM_ setField [1..] xs
+-- | Push non-empty list as numerically indexed table.
+pushNonEmpty :: LuaError e => Pusher e a -> NonEmpty.NonEmpty a -> LuaE e ()
+pushNonEmpty push = pushList push . NonEmpty.toList
+
-- | Push 'Map' as default key-value Lua table.
pushMap :: LuaError e => Pusher e a -> Pusher e b -> Pusher e (Map a b)
pushMap pushKey pushValue m = pushKeyValuePairs pushKey pushValue $ toList m
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/src/HsLua/Marshalling/Userdata.hs
new/hslua-marshalling-2.3.0/src/HsLua/Marshalling/Userdata.hs
--- old/hslua-marshalling-2.2.1/src/HsLua/Marshalling/Userdata.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/src/HsLua/Marshalling/Userdata.hs
2001-09-09 03:46:40.000000000 +0200
@@ -5,9 +5,9 @@
Module : HsLua.Marshalling.Userdata
Copyright : © 2007â2012 Gracjan Polak;
© 2012â2016 Ãmer Sinan AÄacan;
- © 2017-2022 Albert Krewinkel
+ © 2017-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Stability : beta
Portability : non-portable (depends on GHC)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-marshalling-2.2.1/src/HsLua/Marshalling.hs
new/hslua-marshalling-2.3.0/src/HsLua/Marshalling.hs
--- old/hslua-marshalling-2.2.1/src/HsLua/Marshalling.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/src/HsLua/Marshalling.hs 2001-09-09
03:46:40.000000000 +0200
@@ -2,9 +2,9 @@
Module : HsLua.Marshalling
Copyright : © 2007â2012 Gracjan Polak;
© 2012â2016 Ãmer Sinan AÄacan;
- © 2017-2022 Albert Krewinkel
+ © 2017-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Functions to push and retrieve data to and from Lua.
-}
@@ -42,6 +42,9 @@
, peekFieldRaw
, peekPair
, peekTriple
+ , peekNilOr
+ , peekNoneOr
+ , peekNoneOrNilOr
-- ** Lua peek monad
, Peek (..)
, forcePeek
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/test/HsLua/Marshalling/PeekTests.hs
new/hslua-marshalling-2.3.0/test/HsLua/Marshalling/PeekTests.hs
--- old/hslua-marshalling-2.2.1/test/HsLua/Marshalling/PeekTests.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/test/HsLua/Marshalling/PeekTests.hs
2001-09-09 03:46:40.000000000 +0200
@@ -2,9 +2,9 @@
{-# LANGUAGE TypeApplications #-}
{-|
Module : HsLua.Marshalling.PeekTests
-Copyright : © 2020-2022 Albert Krewinkel
+Copyright : © 2020-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Stability : alpha
Portability : OverloadedStrings, TypeApplications
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/test/HsLua/Marshalling/PeekersTests.hs
new/hslua-marshalling-2.3.0/test/HsLua/Marshalling/PeekersTests.hs
--- old/hslua-marshalling-2.2.1/test/HsLua/Marshalling/PeekersTests.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/test/HsLua/Marshalling/PeekersTests.hs
2001-09-09 03:46:40.000000000 +0200
@@ -2,9 +2,9 @@
{-# LANGUAGE TypeApplications #-}
{-|
Module : HsLua.Marshalling.PeekersTests
-Copyright : © 2020-2022 Albert Krewinkel
+Copyright : © 2020-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Tests for Haskell-value retriever functions.
-}
@@ -25,6 +25,7 @@
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as Char8
+import qualified Data.List.NonEmpty as NonEmpty
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Text as T
@@ -278,6 +279,18 @@
runPeek $ peekList peekByteString Lua.top
]
+ , testGroup "peekNonEmpty"
+ [ "empty list" =:
+ Failure "empty list" ["retrieving NonEmpty"] `shouldBeResultOf` do
+ Lua.newtable
+ runPeek $ peekNonEmpty peekBool Lua.top
+
+ , "non-empty list" =:
+ Success (5 NonEmpty.:| [23]) `shouldBeResultOf` do
+ pushLuaExpr "{ 5, 23 }"
+ runPeek $ peekNonEmpty (peekIntegral @Int) Lua.top
+ ]
+
, testGroup "peekSet"
[ "empty set" =:
Success Set.empty `shouldBeResultOf` do
@@ -343,6 +356,7 @@
]
]
+
, testGroup "combinators"
[ testGroup "peekFieldRaw"
[ "access field" =:
@@ -409,6 +423,48 @@
Failure "all choices failed" [] `shouldBeResultOf` do
runPeeker (choice [const $ failPeek @() "nope"]) Lua.top
]
+
+ , testGroup "peekNilOr"
+ [ "returns the parser result if the value is not nil" =:
+ Success (Just "a") `shouldBeResultOf` runPeek
+ (liftLua (Lua.pushstring "a") *> peekNilOr peekString Lua.top)
+ , "returns nothing if the value is nil" =:
+ Success Nothing `shouldBeResultOf` runPeek
+ (liftLua Lua.pushnil *> peekNilOr peekString Lua.top)
+ , "fails if the value is none" =:
+ Failure "string expected, got no value" [] `shouldBeResultOf` runPeek
+ (liftLua Lua.gettop >>= peekNilOr @Maybe peekString . (+1))
+ ]
+
+ , testGroup "peekNoneOr"
+ [ "returns the parser result if a value is present" =:
+ Success (Just "a") `shouldBeResultOf` runPeek
+ (liftLua (Lua.pushstring "a") *> peekNoneOr peekString Lua.top)
+ , "returns the parser result if the value is nil" =:
+ Success (Just ()) `shouldBeResultOf` runPeek
+ (liftLua Lua.pushnil *> peekNoneOr peekNil Lua.top)
+ , "returns `empty` if the value is missing" =:
+ Success Nothing `shouldBeResultOf` runPeek
+ (liftLua Lua.gettop >>= peekNoneOr @Maybe peekString . (+1))
+ , "fails if the parser cannot parse the value" =:
+ Failure "string expected, got nil" [] `shouldBeResultOf` runPeek
+ (liftLua Lua.pushnil *> peekNoneOr @Maybe peekString Lua.top)
+ ]
+ , testGroup "peekNoneOrNilOr"
+ [ "returns the parser result if a value is present" =:
+ Success (Just "a") `shouldBeResultOf` runPeek
+ (liftLua (Lua.pushstring "a") *> peekNoneOrNilOr peekString Lua.top)
+ , "returns `empty` if the value is nil" =:
+ Success Nothing `shouldBeResultOf` runPeek
+ (liftLua Lua.pushnil *> peekNoneOrNilOr @Maybe peekString Lua.top)
+ , "returns `empty` if the value is missing" =:
+ Success Nothing `shouldBeResultOf` runPeek
+ (liftLua Lua.gettop >>= peekNoneOrNilOr @Maybe peekString . (+1))
+ , "fails if the parser cannot parse the value" =:
+ Failure "string expected, got boolean" [] `shouldBeResultOf` runPeek
+ (liftLua (Lua.pushboolean True) *>
+ peekNoneOrNilOr @Maybe peekString Lua.top)
+ ]
]
, testGroup "helper"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/test/HsLua/Marshalling/PushTests.hs
new/hslua-marshalling-2.3.0/test/HsLua/Marshalling/PushTests.hs
--- old/hslua-marshalling-2.2.1/test/HsLua/Marshalling/PushTests.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/test/HsLua/Marshalling/PushTests.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,12 +1,11 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
{-|
Module : HsLua.Marshalling.PushTests
-Copyright : © 2020-2022 Albert Krewinkel
+Copyright : © 2020-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Stability : alpha
Portability : OverloadedStrings, TypeApplications
@@ -28,10 +27,6 @@
import Test.Tasty.HUnit (Assertion, assertFailure)
import Test.Tasty.QuickCheck (Arbitrary, testProperty)
-#if !MIN_VERSION_base(4,12,0)
-import Data.Semigroup (Semigroup ((<>)))
-#endif
-
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified HsLua.Core as Lua
@@ -160,6 +155,14 @@
, testSingleElementProperty (pushList pushText)
]
+ , testGroup "pushNonEmpty"
+ [ testProperty "table size equals list length" $ \list -> monadicIO $ do
+ tableSize <- run $ Lua.run @Lua.Exception $ do
+ pushNonEmpty pushString list
+ Lua.rawlen Lua.top
+ assert $ tableSize == length list
+ ]
+
, testGroup "pushKeyValuePairs"
[ testProperty "creates a table" $ \x -> monadicIO $ do
producesTable <- run $ Lua.run @Lua.Exception $ do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/test/HsLua/Marshalling/UserdataTests.hs
new/hslua-marshalling-2.3.0/test/HsLua/Marshalling/UserdataTests.hs
--- old/hslua-marshalling-2.2.1/test/HsLua/Marshalling/UserdataTests.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/test/HsLua/Marshalling/UserdataTests.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,9 +1,9 @@
{-# LANGUAGE OverloadedStrings #-}
{-|
Module : HsLua.Marshalling.UserdataTests
-Copyright : © 2018-2022 Albert Krewinkel
+Copyright : © 2018-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Tests that any data type can be pushed to Lua as userdata.
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/test/HsLua/MarshallingTests.hs
new/hslua-marshalling-2.3.0/test/HsLua/MarshallingTests.hs
--- old/hslua-marshalling-2.2.1/test/HsLua/MarshallingTests.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/test/HsLua/MarshallingTests.hs 2001-09-09
03:46:40.000000000 +0200
@@ -2,9 +2,9 @@
{-# LANGUAGE OverloadedStrings #-}
{-|
Module : HsLua.MarshallingTests
-Copyright : © 2020-2022 Albert Krewinkel
+Copyright : © 2020-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Stability : alpha
Portability : OverloadedStrings, TypeApplications
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-marshalling-2.2.1/test/test-hslua-marshalling.hs
new/hslua-marshalling-2.3.0/test/test-hslua-marshalling.hs
--- old/hslua-marshalling-2.2.1/test/test-hslua-marshalling.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/hslua-marshalling-2.3.0/test/test-hslua-marshalling.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,8 +1,8 @@
{-|
Module : Main
-Copyright : © 2017-2022 Albert Krewinkel
+Copyright : © 2017-2023 Albert Krewinkel
License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
+Maintainer : Albert Krewinkel <[email protected]>
Tests for HsLua.
-}