lua-arbitrary-1.0.1.1/0000755000000000000000000000000007346545000012617 5ustar0000000000000000lua-arbitrary-1.0.1.1/CHANGELOG.md0000644000000000000000000000071707346545000014435 0ustar0000000000000000# Changelog `lua-arbitrary` uses [PVP Versioning][]. ## lua-arbitrary-1.0.1.1 Released 2023-03-13. - Allow lua-2.3.*. ## lua-arbitrary-1.0.1 Released 2022-02-19. - Allow lua-2.2.0 (includes Lua 5.4). - Implemented `shrink` for Lua integers and numbers. - Explicitly disable shrinking for TypeCode, StatusCode, and OPCode. ## lua-arbitrary-1.0.0 Released 29-01-2022. Extracted from hslua-1.3.0. [PVP Versioning]: https://pvp.haskell.org lua-arbitrary-1.0.1.1/LICENSE0000644000000000000000000000224107346545000013623 0ustar0000000000000000Copyright © 1994-2022 Lua.org, PUC-Rio. Copyright © 2007-2012 Gracjan Polak Copyright © 2012-2015 Ömer Sinan Ağacan 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 "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lua-arbitrary-1.0.1.1/README.md0000644000000000000000000000114707346545000014101 0ustar0000000000000000# lua-arbitrary [![Build status][GitHub Actions badge]][GitHub Actions] [![AppVeyor Status]](https://ci.appveyor.com/project/tarleb/hslua-r2y18) [![Hackage]](https://hackage.haskell.org/package/lua-arbitrary) This package provides (orphaned) instances of QuickCheck's "Arbitrary" typeclass. [GitHub Actions badge]: https://img.shields.io/github/workflow/status/hslua/hslua/CI.svg?logo=github [GitHub Actions]: https://github.com/hslua/hslua/actions [AppVeyor Status]: https://ci.appveyor.com/api/projects/status/ldutrilgxhpcau94/branch/main?svg=true [Hackage]: https://img.shields.io/hackage/v/lua-arbitrary.svg lua-arbitrary-1.0.1.1/lua-arbitrary.cabal0000644000000000000000000000365707346545000016374 0ustar0000000000000000cabal-version: 2.2 name: lua-arbitrary version: 1.0.1.1 synopsis: Arbitrary instances for Lua types. description: Provides instances for QuickCheck's \"Arbitrary\" typeclass. homepage: https://hslua.org/ bug-reports: https://github.com/hslua/hslua/issues license: MIT license-file: LICENSE author: Albert Krewinkel, Gracjan Polak, Ömer Sinan Ağacan maintainer: tarleb@hslua.org copyright: © 2007–2012 Gracjan Polak; © 2012–2016 Ömer Sinan Ağacan; © 2017-2023 Albert Krewinkel category: Foreign build-type: Simple extra-source-files: README.md , CHANGELOG.md 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.5 , GHC == 9.4.4 source-repository head type: git location: https://github.com/hslua/hslua.git common common-options default-language: Haskell2010 build-depends: base >= 4.11 && < 5 , lua >= 2.0 && < 2.4 , QuickCheck >= 2.7 && < 3 ghc-options: -Wall -Wincomplete-record-updates -Wnoncanonical-monad-instances -Wredundant-constraints if impl(ghc >= 8.2) ghc-options: -Wcpp-undef -Werror=missing-home-modules if impl(ghc >= 8.4) ghc-options: -Widentities -Wincomplete-uni-patterns -Wpartial-fields -fhide-source-paths library import: common-options exposed-modules: Lua.Arbitrary hs-source-dirs: src lua-arbitrary-1.0.1.1/src/Lua/0000755000000000000000000000000007346545000014127 5ustar0000000000000000lua-arbitrary-1.0.1.1/src/Lua/Arbitrary.hs0000644000000000000000000000203507346545000016422 0ustar0000000000000000{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Instances for QuickCheck's Arbitrary. -} module Lua.Arbitrary () where import Lua import Test.QuickCheck instance Arbitrary Lua.Integer where arbitrary = arbitrarySizedIntegral shrink = shrinkIntegral instance Arbitrary Lua.Number where arbitrary = Lua.Number <$> arbitrary shrink = shrinkRealFrac instance Arbitrary Lua.TypeCode where arbitrary = elements [ LUA_TNONE , LUA_TNIL , LUA_TBOOLEAN , LUA_TLIGHTUSERDATA , LUA_TNUMBER , LUA_TSTRING , LUA_TTABLE , LUA_TFUNCTION , LUA_TUSERDATA , LUA_TTHREAD ] shrink = shrinkNothing instance Arbitrary Lua.StatusCode where arbitrary = elements [ LUA_OK , LUA_YIELD , LUA_ERRRUN , LUA_ERRSYNTAX , LUA_ERRMEM #if !MIN_VERSION_lua(2,2,0) , LUA_ERRGCMM #endif , LUA_ERRERR , LUA_ERRFILE ] shrink = shrinkNothing instance Arbitrary Lua.OPCode where arbitrary = elements [ LUA_OPEQ , LUA_OPLT , LUA_OPLE ] shrink = shrinkNothing