CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 13:58:19 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"c662359a6800f9a8586b9fb9723b4173"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=dAi2M6qnHppELYQBX22dLTz5c1pwTI4xEXmtt2MTI8m3ynbSzNFG3BWzwdK%2BKKrHX2RqJEaBJe%2FJu8I%2BuKAr9b850aPh6j4UfGQ4sTl9EKeG2HMol5gt7Rri%2BHkPsbjdb5dTyUzdnbCbVoSDR1C6sl2Hbp57yRxCq43pO8OcC2af36DpTmznDAuhUu9jTlEGKSoHKYI9usaoZop445w98ke5zhA6jvUZMr7lXdYzJmA1XSWguWNElpRwihYgIP6gVA5oDztXsq6s8rRoAQ9mTA%3D%3D--ynqv%2FNPD6aJsXE5I--nrzbYCAxNd3S8WkO%2FkioaA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1118744724.1753624699; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 13:58:19 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 13:58:19 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 9B96:2F5ED7:EB5C4A:1360ACE:6886307A
Simple shell command language test library. · GitHub
Show Gist options
Save rtomayko/3877539 to your computer and use it in GitHub Desktop.
{{ message }}
Instantly share code, notes, and snippets.
Last active
October 1, 2024 13:07
-
Star
18
(18)
You must be signed in to star a gist -
Fork
4
(4)
You must be signed in to fork a gist
-
Save rtomayko/3877539 to your computer and use it in GitHub Desktop.
Simple shell command language test library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: . testlib.sh | |
# Simple shell command language test library. | |
# | |
# Tests must follow the basic form: | |
# | |
# begin_test "the thing" | |
# ( | |
# set -e | |
# echo "hello" | |
# false | |
# ) | |
# end_test | |
# | |
# When a test fails its stdout and stderr are shown. | |
# | |
# Note that tests must `set -e' within the subshell block or failed assertions | |
# will not cause the test to fail and the result may be misreported. | |
# | |
# Copyright (c) 2011-13 by Ryan Tomayko <https://tomayko.com> | |
# License: MIT | |
set -e | |
# Put bin path on PATH | |
PATH="$(cd $(dirname "$0")/.. && pwd)/bin:$PATH" | |
# create a temporary work space | |
TMPDIR="$(cd $(dirname "$0")/.. && pwd)"/tmp | |
TRASHDIR="$TMPDIR/$(basename "$0")-$$" | |
# keep track of num tests and failures | |
tests=0 | |
failures=0 | |
# this runs at process exit | |
atexit () { | |
rm -rf "$TRASHDIR" | |
if [ $failures -gt 0 ] | |
then exit 1 | |
else exit 0 | |
fi | |
} | |
# create the trash dir | |
trap "atexit" EXIT | |
mkdir -p "$TRASHDIR" | |
cd "$TRASHDIR" | |
# Mark the beginning of a test. A subshell should immediately follow this | |
# statement. | |
begin_test () { | |
test_status=$? | |
[ -n "$test_description" ] && end_test $test_status | |
unset test_status | |
tests=$(( tests + 1 )) | |
test_description="$1" | |
exec 3>&1 4>&2 | |
out="$TRASHDIR/out" | |
err="$TRASHDIR/err" | |
exec 1>"$out" 2>"$err" | |
# allow the subshell to exit non-zero without exiting this process | |
set -x +e | |
} | |
# Mark the end of a test. | |
end_test () { | |
test_status="${1:-$?}" | |
set +x -e | |
exec 1>&3 2>&4 | |
if [ "$test_status" -eq 0 ]; then | |
printf "test: %-60s OK\n" "$test_description ..." | |
else | |
failures=$(( failures + 1 )) | |
printf "test: %-60s FAILED\n" "$test_description ..." | |
( | |
echo "-- stdout --" | |
sed 's/^/ /' <"$TRASHDIR/out" | |
echo "-- stderr --" | |
grep -v -e '^\+ end_test' -e '^+ set +x' <"$TRASHDIR/err" | | |
sed 's/^/ /' | |
) 1>&2 | |
fi | |
unset test_description | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can’t perform that action at this time.