commit - 9e88f9d9a5df5ab1462296b2ba998f33a1c56ea4
commit + 87890bc26c1c6958bd64bb9d46fbc29ba6a92d95
blob - 0bdee55c775294875ff9724aa4f7744fe0c7b43b
blob + 6892df7536c1a19134db4827c42f870d903c65a7
--- regress/gotd/http_notification.sh
+++ regress/gotd/http_notification.sh
d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
- cat <<-EOF > $testroot/stdout.expected
- {"notifications":[{"short":false,"id":"$commit_id","author":"$GOT_AUTHOR","date":"$d","message":"make changes\n","diffstat":{},"changes":{}}]}
+ touch "$testroot/stdout.expected"
+ ed -s "$testroot/stdout.expected" <<-EOF
+ a
+ {"notifications":[{
+ "short":false,
+ "id":"$commit_id",
+ "author":"$GOT_AUTHOR",
+ "date":"$d",
+ "message":"make changes\n",
+ "diffstat":{},
+ "changes":{}
+ }]}
+ .
+ ,j
+ w
EOF
cmp -s $testroot/stdout.expected $testroot/stdout
s=`pop_idx $i "$@"`
commit_id=$(echo $s | cut -d' ' -f1)
commit_time=$(echo $s | sed -e "s/^$commit_id //g")
- printf '%s{"short":false,"id":"%s","author":"%s","date":"%s","message":"%s","diffstat":{},"changes":{}}' \
- "$comma" "$commit_id" "$GOT_AUTHOR" "$commit_time" "make changes\n"
- comma=","
+
+ echo "$comma"
+ comma=','
+
+ cat <<-EOF
+ {
+ "short":false,
+ "id":"$commit_id",
+ "author":"$GOT_AUTHOR",
+ "date":"$commit_time",
+ "message":"make changes\n",
+ "diffstat":{},
+ "changes":{}
+ }
+ EOF
done >> $testroot/stdout.expected
echo "]}" >> $testroot/stdout.expected
+ ed -s "$testroot/stdout.expected" <<-EOF
+ ,j
+ w
+ EOF
cmp -s $testroot/stdout.expected $testroot/stdout
ret=$?
s=`pop_idx $i "$@"`
commit_id=$(echo $s | cut -d' ' -f1)
commit_time=$(echo $s | sed -e "s/^$commit_id //g")
- printf '%s{"short":true,"id":"%s","author":"%s","date":"%s","message":"%s"}' \
- "$comma" "$commit_id" "$GOT_AUTHOR_8" \
- "$commit_time" "make changes"
- comma=","
+
+ echo "$comma"
+ comma=','
+
+ cat <<-EOF
+ {
+ "short":true,
+ "id":"$commit_id",
+ "author":"$GOT_AUTHOR_8",
+ "date":"$commit_time",
+ "message":"make changes"
+ }
+ EOF
done >> $testroot/stdout.expected
echo "]}" >> $testroot/stdout.expected
+ ed -s "$testroot/stdout.expected" <<-EOF
+ ,j
+ w
+ EOF
cmp -s $testroot/stdout.expected $testroot/stdout
ret=$?