This commit is contained in:
Dmitry Zuikov 2024-05-17 07:21:47 +03:00
parent 4fe7ac911a
commit 41830ea2f2
4 changed files with 18 additions and 18 deletions

View File

@ -36,19 +36,18 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1715856223,
"narHash": "sha256-Q9I6YbvzGuV9yHtxGxxU10LMQf9AdcsecSszPT7PDuc=",
"ref": "sexp-parser",
"rev": "b0a7f96d6569d16b0d27c2f9477d94e5ee39df66",
"revCount": 62,
"lastModified": 1715918584,
"narHash": "sha256-moioa3ixAZb0y/xxyxUVjSvXoSiDGXy/vAx6B70d2yM=",
"ref": "refs/heads/master",
"rev": "831879978213a1aed15ac70aa116c33bcbe964b8",
"revCount": 63,
"type": "git",
"url": "http://git.hbs2/GmcLB9gEPT4tbx9eyQiECwsu8oPyEh6qKEpQDtyBWVPA"
"url": "http://git.hbs2/GmcLB9gEPT4tbx9eyQiECwsu8oPyEh6qKEpQDtyBWVPA?tag=0.1.3.1"
},
"original": {
"ref": "sexp-parser",
"rev": "b0a7f96d6569d16b0d27c2f9477d94e5ee39df66",
"rev": "831879978213a1aed15ac70aa116c33bcbe964b8",
"type": "git",
"url": "http://git.hbs2/GmcLB9gEPT4tbx9eyQiECwsu8oPyEh6qKEpQDtyBWVPA"
"url": "http://git.hbs2/GmcLB9gEPT4tbx9eyQiECwsu8oPyEh6qKEpQDtyBWVPA?tag=0.1.3.1"
}
},
"haskell-flake-utils": {

View File

@ -7,7 +7,7 @@ inputs = {
fuzzy.url =
# "git+http://git.hbs2/GmcLB9gEPT4tbx9eyQiECwsu8oPyEh6qKEpQDtyBWVPA?ref=sexp-parser&rev=bd3a38904864d5cc333974e7b029412607b46871";
"git+http://git.hbs2/GmcLB9gEPT4tbx9eyQiECwsu8oPyEh6qKEpQDtyBWVPA?ref=sexp-parser&rev=b0a7f96d6569d16b0d27c2f9477d94e5ee39df66";
"git+http://git.hbs2/GmcLB9gEPT4tbx9eyQiECwsu8oPyEh6qKEpQDtyBWVPA?tag=0.1.3.1&rev=831879978213a1aed15ac70aa116c33bcbe964b8";
};

View File

@ -1,6 +1,6 @@
cabal-version: 3.0
name: suckless-conf
version: 0.1.2.4
version: 0.1.2.6
-- synopsis:
-- description:
license: BSD-3-Clause
@ -82,7 +82,7 @@ library
, text
, vector
, unordered-containers
, fuzzy-parse >= 0.1.3.0
, fuzzy-parse >= 0.1.3.1
hs-source-dirs: lib
default-language: Haskell2010
@ -109,7 +109,7 @@ test-suite spec
, aeson
, scientific
, suckless-conf
, fuzzy-parse >= 0.1.3.0
, fuzzy-parse >= 0.1.3.1
, containers
, mtl
, text
@ -125,3 +125,4 @@ test-suite spec
, OverloadedStrings
, ScopedTypeVariables
, TypeApplications

View File

@ -60,21 +60,21 @@ spec = do
it "reads int" $ do
c <- readConfig [qc|1|] <&> toJSON
c `shouldBe` toJSON [1::Int]
c `shouldBe` toJSON [[1::Int]]
it "reads scientific" $ do
c <- readConfig [qc|1.00|] <&> toJSON
c `shouldBe` toJSON [1.00 :: Scientific]
c `shouldBe` toJSON [[1.00 :: Scientific]]
it "reads bool" $ do
t <- readConfig [qc|#t|] <&> toJSON . head
t `shouldBe` toJSON (Bool True)
t `shouldBe` toJSON [Bool True]
f <- readConfig [qc|#f|] <&> toJSON . head
f `shouldBe` toJSON (Bool False)
f `shouldBe` toJSON [Bool False]
it "reads string" $ do
s <- readConfig [qc|"somestring"|] <&> toJSON
s `shouldBe` toJSON ["somestring" :: String]
s `shouldBe` toJSON [["somestring" :: String]]
it "reads array" $ do
s <- readConfig [qc|(1 2 3 4)|] <&> toJSON . head