luhn 0.2 → 0.3
raw patch · 7 files changed
+59/−39 lines, 7 filesdep +luhndep ~QuickCheckdep ~digitssetup-changedPVP ok
version bump matches the API change (PVP)
Dependencies added: luhn
Dependency ranges changed: QuickCheck, digits
API changes (from Hackage documentation)
Files
- CHANGELOG.md +11/−0
- LICENSE +1/−1
- Setup.lhs +0/−7
- luhn.cabal +32/−18
- src/Luhn.hs +1/−1
- src/Tests.hs +0/−12
- test/Tests.hs +14/−0
+ CHANGELOG.md view
@@ -0,0 +1,11 @@+# 0.3++Support for GHC 9.10.2.++# 0.2++Ported to use Digits library++# 0.1++Initial release
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2008, N-Sim Ltd.+Copyright (c) 2008-2009, N-Sim Ltd., (c) 2025 Henry Bucklow All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
− Setup.lhs
@@ -1,7 +0,0 @@-#! /usr/bin/env runhaskell--> import Distribution.Simple-> import System.Cmd-> tests _ _ _ _ = system "runhaskell src/Tests.hs" >> return ()-> main = defaultMainWithHooks (simpleUserHooks {runTests = tests})-
luhn.cabal view
@@ -1,19 +1,33 @@-Build-Type: Custom-Name: luhn-Category: Data-Version: 0.2-Cabal-Version: >= 1.2-Synopsis: An implementation of Luhn's check digit algorithm.-Description: An implementation of Luhn's check digit algorithm.-License: BSD3-License-File: LICENSE-Copyright: (c) 2008-2009 N-Sim Ltd.-Author: Henry Bucklow-Maintainer: jhb@n-sim.com-Tested-With: GHC==6.12-Build-Depends: base >= 4 && < 5, QuickCheck, digits-Exposed-Modules: Luhn-Hs-Source-Dirs: src-Extra-Source-Files: src/Tests.hs-GHC-Options: -Wall+cabal-version: 3.8+name: luhn+version: 0.3+category: Data+synopsis: An implementation of Luhn's check digit algorithm.+description: An implementation of Luhn's check digit algorithm. This is a simple algorithm+ used to validate a variety of identification numbers, such as credit card numbers.+ See <http://en.wikipedia.org/wiki/Luhn_algorithm> for more details.+license: BSD-3-Clause+license-file: LICENSE+copyright: (c) 2008-2009 N-Sim Ltd., 2025 Henry Bucklow+author: Henry Bucklow+maintainer: opensource@elsie.org.uk+tested-with: GHC==9.12.2+extra-doc-files: CHANGELOG.md +source-repository head+ type: git+ location: https://github.com/sffubs/luhn.git++library+ build-depends: base >= 4 && < 5, digits < 1, QuickCheck < 3+ exposed-modules: Luhn+ hs-source-dirs: src+ ghc-options: -Wall+ default-language: Haskell2010++test-suite luhn-tests+ hs-source-dirs: test+ main-is: Tests.hs+ ghc-options: -Wall+ build-depends: base >= 4 && < 5, luhn, QuickCheck+ default-language: Haskell2010
src/Luhn.hs view
@@ -21,7 +21,7 @@ ) where import Data.Digits-import Test.QuickCheck+import Test.QuickCheck hiding (total) -- | Like Python's enumerate function - returns a tuple where the first -- element is the index from 0 of the second element in the input list.
− src/Tests.hs
@@ -1,12 +0,0 @@-module Main where--import Luhn-import Text.Printf-import Test.QuickCheck--tests = [- ("checkLuhn", quickCheck prop_checkLuhn),- ("checkSingleError", quickCheck prop_checkSingleError)]--main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests-
+ test/Tests.hs view
@@ -0,0 +1,14 @@+module Main where++import Luhn+import Text.Printf+import Test.QuickCheck++tests :: [(String, IO ())]+tests = [+ ("checkLuhn", quickCheck prop_checkLuhn),+ ("checkSingleError", quickCheck prop_checkSingleError)]++main :: IO ()+main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests+