Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ if(ONE_INDEX)
sourcemeta_one_test_cli(common index fail-self-referencing-metaschema)
sourcemeta_one_test_cli(common index fail-unknown-dialect)
sourcemeta_one_test_cli(common index fail-unknown-option)
sourcemeta_one_test_cli(common index fail-vocabulary-not-object)
sourcemeta_one_test_cli(common index draft4-ignore-vocabulary)
sourcemeta_one_test_cli(common index extra-files-on-rebuild)
sourcemeta_one_test_cli(common index directory-schema-same-name)
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/collection-path-dot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ EOF
2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "0" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/collection-path-empty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ EOF
2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "0" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/collection-path-skips-config-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ EOF
2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "0" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
18 changes: 10 additions & 8 deletions test/cli/index/common/draft4-ignore-vocabulary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ cat << 'EOF' > "$TMP/schemas/test.json"
}
EOF

"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt"
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt"
remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-bundle-ref-no-fragment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ EOF
2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-external-reference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-invalid-schema-json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-invalid-schema-non-string-dialect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-invalid-schema-non-string-id.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-invalid-schema-top-level-ref-draft7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-invalid-schema-uri-percentage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-invalid-schema-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ printf '%s\n' '*undefined_anchor' > "$TMP/schemas/test.yaml"
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-invalid-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-maximum-entries-non-numeric-value.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 --maximum-direct-directory-entries abc 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-non-schema-array.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ EOF
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
17 changes: 10 additions & 7 deletions test/cli/index/common/fail-non-schema-yaml-array.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ printf '%s\n' '---' '- one' '- two' > "$TMP/schemas/test.yaml"
"$1" --skip-banner "$TMP/one.json" "$TMP/output" --concurrency 1 2> "$TMP/output.txt" && CODE="$?" || CODE="$?"
test "$CODE" = "1" || exit 1

# Remove thread information
if [ "$(uname)" = "Darwin" ]
then
sed -i '' 's/ \[.*\]//g' "$TMP/output.txt"
else
sed -i 's/ \[.*\]//g' "$TMP/output.txt"
fi
remove_threads_information() {
expr='s/ \[[^]]*[^a-z-][^]]*\]//g'
if [ "$(uname -s)" = "Darwin" ]; then
sed -i '' "$expr" "$1"
else
sed -i "$expr" "$1"
fi
}

remove_threads_information "$TMP/output.txt"

cat << EOF > "$TMP/expected.txt"
Writing output to: $(realpath "$TMP")/output
Expand Down
Loading
Loading