verbosity

pull/30/head
deadc0de6 1 year ago
parent 30c1af0d15
commit ac79557d5d

@ -55,6 +55,7 @@ ${bin} -B index -c --catalog="${catalog}" github .github
echo "" echo ""
# compare keys # compare keys
echo "compare keys"
src="tests-ng/assets/github.catalog.json" src="tests-ng/assets/github.catalog.json"
src_keys="${tmpd}/src-keys" src_keys="${tmpd}/src-keys"
dst_keys="${tmpd}/dst-keys" dst_keys="${tmpd}/dst-keys"
@ -63,6 +64,7 @@ cat "${catalog}" | jq '.. | keys?' | jq '.[]' > "${dst_keys}"
diff "${src_keys}" "${dst_keys}" diff "${src_keys}" "${dst_keys}"
# compare children 1 # compare children 1
echo "compare children 1"
src_keys="${tmpd}/src-child1" src_keys="${tmpd}/src-child1"
dst_keys="${tmpd}/dst-child1" dst_keys="${tmpd}/dst-child1"
cat "${src}" | jq '. | select(.type=="top") | .children | .[].name' > "${src_keys}" cat "${src}" | jq '. | select(.type=="top") | .children | .[].name' > "${src_keys}"
@ -70,6 +72,7 @@ cat "${catalog}" | jq '. | select(.type=="top") | .children | .[].name' > "${dst
diff "${src_keys}" "${dst_keys}" diff "${src_keys}" "${dst_keys}"
# compare children 2 # compare children 2
echo "compare children 2"
src_keys="${tmpd}/src-child2" src_keys="${tmpd}/src-child2"
dst_keys="${tmpd}/dst-child2" dst_keys="${tmpd}/dst-child2"
cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[].name' > "${src_keys}" cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[].name' > "${src_keys}"
@ -77,6 +80,7 @@ cat "${catalog}" | jq '. | select(.type=="top") | .children | .[] | select(.name
diff "${src_keys}" "${dst_keys}" diff "${src_keys}" "${dst_keys}"
# compare children 3 # compare children 3
echo "compare children 3"
src_keys="${tmpd}/src-child3" src_keys="${tmpd}/src-child3"
dst_keys="${tmpd}/dst-child3" dst_keys="${tmpd}/dst-child3"
cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[] | select(.name=="workflows") | .children | .[].name' > "${src_keys}" cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[] | select(.name=="workflows") | .children | .[].name' > "${src_keys}"
@ -84,6 +88,7 @@ cat "${catalog}" | jq '. | select(.type=="top") | .children | .[] | select(.name
diff "${src_keys}" "${dst_keys}" diff "${src_keys}" "${dst_keys}"
# native # native
echo "compare native output"
native="${tmpd}/native.txt" native="${tmpd}/native.txt"
${bin} -B ls -s -r --format=native --catalog="${catalog}" > "${native}" ${bin} -B ls -s -r --format=native --catalog="${catalog}" > "${native}"
mod="${tmpd}/native.mod.txt" mod="${tmpd}/native.mod.txt"
@ -96,6 +101,7 @@ fi
diff --color=always "tests-ng/assets/github.catalog.native.txt" "${mod}" diff --color=always "tests-ng/assets/github.catalog.native.txt" "${mod}"
# csv # csv
echo "compare csv output"
csv="${tmpd}/csv.txt" csv="${tmpd}/csv.txt"
${bin} -B ls -s -r --format=csv --catalog="${catalog}" > "${csv}" ${bin} -B ls -s -r --format=csv --catalog="${catalog}" > "${csv}"
# modify created csv # modify created csv

Loading…
Cancel
Save