mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-11 04:45:57 +03:00
Fix doctests (#9225)
Haven’t tracked down when they broke. They used to work at some point but atm they are very broken and don’t test anything. This PR fixes the bash mess to parse the files correctly and fixes two minor issues that creeped in by virtue of the doctests being broken. changelog_begin changelog_end
This commit is contained in:
parent
b0c0306696
commit
4fd1cf7c28
@ -320,6 +320,7 @@ daml_doc_test(
|
||||
flags = ["--no-dflags-check"],
|
||||
ignored_srcs = [
|
||||
"LibraryModules.daml",
|
||||
"DA/Experimental/Example.daml",
|
||||
"DA/Time/Types.daml",
|
||||
],
|
||||
)
|
||||
|
@ -82,8 +82,8 @@ fromList list = foldl (\acc (key, value) -> insert key value acc) empty list
|
||||
--
|
||||
-- ```
|
||||
-- >>> fromListWith (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])]
|
||||
-- Map [("A", [1, 2, 3]), ("B", [2, 1])]
|
||||
-- >>> fromListWith (++) [] == (M.empty : Map Text [Int])
|
||||
-- fromList [("A", [1, 2, 3]), ("B", [2, 1])]
|
||||
-- >>> fromListWith (++) [] == (empty : Map Text [Int])
|
||||
-- True
|
||||
-- ```
|
||||
fromListWith : Ord k => (v -> v -> v) -> [(k, v)] -> Map k v
|
||||
|
@ -383,16 +383,21 @@ def daml_doc_test(
|
||||
name = name,
|
||||
data = [cpp, damlc] + srcs,
|
||||
cmd = """\
|
||||
set -eou pipefail
|
||||
CPP=$$(canonicalize_rlocation $(rootpath {cpp}))
|
||||
DAMLC=$$(canonicalize_rlocation $(rootpath {damlc}))
|
||||
FILES=($$(
|
||||
for file in {files}; do
|
||||
IGNORED=false
|
||||
for pattern in {ignored}; do
|
||||
if [[ $$file = *$$pattern ]]; then
|
||||
IGNORED=true
|
||||
continue
|
||||
fi
|
||||
echo $$(canonicalize_rlocation $$i)
|
||||
done
|
||||
if [[ $$IGNORED == "false" ]]; then
|
||||
echo $$(canonicalize_rlocation $$file)
|
||||
fi
|
||||
done
|
||||
))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user