fugue / goldplate Goto Github PK
View Code? Open in Web Editor NEWa cute and simple golden test runner for CLI applications
License: Apache License 2.0
a cute and simple golden test runner for CLI applications
License: Apache License 2.0
0.2.1 has a release here, dated 2022-04-11: https://github.com/fugue/goldplate/releases/tag/v0.2.1
But it seems it has been forgotten to push it to Hackage.
I'd say current master
can be released to Hackage as 0.2.1 and the tag can be moved. The only difference seems to be the bump to aeson
: 0.2.1...master
Blockers:
I managed to build and test goldplate
with the following cabal.project.local
. So, it seems goldplate
is GHC-9.4 ready, we only need the ecosystem to catch up.
allow-newer: *:template-haskell
allow-newer: hashable:*
allow-newer: regex-pcre-builtin:base
allow-newer: async:base
allow-newer: scientific:base
allow-newer: integer-logarithms:*
allow-newer: aeson:*
allow-newer: indexed-traversable:base
allow-newer: indexed-traversable-instances:base
allow-newer: time-compat:base
allow-newer: these:base
allow-newer: attoparsec:*
allow-newer: assoc:base
allow-newer: text-short:*
allow-newer: semialign:base
allow-newer: data-fix:base
allow-newer: splitmix:base
allow-newer: OneTuple:base
constraints: aeson >= 2.1
@jaspervdj-luminal I'd like goldplate to be in stackage, so I filed commercialhaskell/stackage#6052
There I (implicitly) volunteered as stackage maintainer for goldplate, but I am happy to leave this role to you if you are willing to take it.
It would be nice if
cabal test
ran goldplate
's own testsuite. I suppose this would be easy to implement by adding a suitable test-suite
stanza to the .cabal
file.
The benefit would be that users of goldplate
could easily learn how to integrate goldplate
into their own .cabal
-files, by copy-pasting that stanza.
It is the first example in the docs, so I dare to ask - what does the variable in the headline contain? Is this example self-fulfilling(any output will be considered valid)?
Assertion 'created_directory' eagerly removes directory before other assertions are checked.
E.g. you cannot place the created_directory
assertion before the created_file
assertion here:
https://github.com/fugue/goldplate/blob/a2c20310149a69522d0efc2cdcd8e1081f5f93b4/tests/create.goldplate#L9-L13
A bit too imperative for my taste. I would have expected a declarative approach to these assertions, so that the order in which I write these do not matter.
To keep goldplate
in Stackage, we need to allow aeson-2
. I can make the necessary revisions on hackage, but atm, we are blocked on:
$ goldplate tests
...
not ok tests/stdin.goldplate: stdout
...
On macOS, echo -n "hi" | wc -c
outputs some spaces before the letter count:
$ echo -n "hi" | wc -c
2
$ echo -n "hi" | wc -c | hexdump
0000000 20 20 20 20 20 20 20 32 0a
0000009
I get not ok ... stdout
verdicts under Windows when the same tests pass under Linux and macOS.
I'd guess these are caused by directory globbing resolved under Windows using backslashes instead of slashes, so printing the filepath to stdout gives different results under Linux and Windows. https://github.com/andreasabel/miniagda/blob/67f9ad914f8bbda153d679a517da98b01e482d4e/test/fail/adm/adm1.err#L1
Since Windows nowadays understands the slash as path separator, maybe the slash could be used instead of the backslash to make goldplate
more portable?
I accidently put this in my .goldplate
file:
{ "command" : "runghc"
, "input_files" : "*.hs"
, "arguments" : [ "${GOLDPLATE_INPUT_FILE}" ]
, "asserts" :
[ { "exit_code" : 0
, "stdout" : "${GOLDPLATE_INPUT_NAME}.golden"
}
]
}
Correct would have been:
, "asserts" :
[ { "exit_code" : 0 }
, { "stdout" : "${GOLDPLATE_INPUT_NAME}.golden" }
]
goldplate
simply ignored the stdout
part. I would have preferred an error message alerting me of my mistake.
Blocked on:
I tried
$ cabal build --allow-newer=aeson:all --constraint='aeson==2.*' \
--allow-newer=scientific:{base,template-haskell} --constraint='scientific==0.3.7.*' \
--allow-newer=semialign:base
but semialign
does not build with 9.2 because Option
was removed from base-4.16
.
goldplate
builds with cabal build --allow-newer
.
aeson-pretty >= 0.8 && < 0.9,
async >= 2.2 && < 2.3,
base >= 4.9 && < 5,
- bytestring >= 0.10 && < 0.11,
+ bytestring >= 0.10 && < 0.12,
Diff >= 0.3 && < 0.5,
directory >= 1.3 && < 1.4,
filepath >= 1.4 && < 1.5,
Glob >= 0.10 && < 0.11,
- optparse-applicative >= 0.14 && < 0.16,
+ optparse-applicative >= 0.14 && < 0.17,
process >= 1.6 && < 1.7,
regex-pcre-builtin >= 0.95.1.3 && < 0.96,
text >= 1.2 && < 1.3,
- time >= 1.8 && < 1.10,
+ time >= 1.8 && < 1.12,
unordered-containers >= 0.2 && < 0.3
I'm trying to package goldplate in Debian. I've an issue with regex-pcre-builtin, which is not packaged (and, from what I understood, not wanted) in Debian. regex-pcre is already packaged, but it does not seem to have Text.Regex.PCRE.Text
. Is there a reason why Text are used in src/Text/Regex/PCRE/Simple.hs, and not Bytestring? It would help packaging a lot if I could use regex-pcre instead of regex-pcre-builtin...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.