make diff tests more stable

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-06-10 17:42:54 +02:00
parent e64d066db4
commit d70656db68
5 changed files with 64 additions and 5 deletions

View File

@ -11,7 +11,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ v0.96-pre-30-g769d07d
#### $$VERSION$$ v0.96-pre-31-ge64d066
#
# Exit Codes:
# - 0 sucess (hopefully)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.96-dev-7-g0153928
#### $$VERSION$$ v0.96-pre-31-ge64d066
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh
@ -37,7 +37,9 @@ do
# output processed input
print_array "iQUERY" >"${OUTPUTFILE}"
diff -c "${REFFILE}" "${OUTPUTFILE}" || exit 1
sort -d -o "${OUTPUTFILE}.sort" "${OUTPUTFILE}"
sort -d -o "${REFFILE}.sort" "${REFFILE}"
diff -c "${REFFILE}.sort" "${OUTPUTFILE}.sort" || exit 1
echo "${SUCCESS}"
done

View File

@ -0,0 +1,5 @@
iQUERY: 0 message
iQUERY: FIRST_NAME Kay
iQUERY: LAST_NAME M
iQUERY: USER_ID 123456789
iQUERY: USERNAME Gnadelwartz

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.96-dev3-0-gdddd1ce
#### $$VERSION$$ v0.96-pre-31-ge64d066
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh
@ -35,7 +35,9 @@ CHAT[ID]="123456789"
# output processed input
print_array "USER" "CHAT" "REPLYTO" "FORWARD" "URLS" "CONTACT" "CAPTION" "LOCATION" "MESSAGE" "VENUE" "SERVICE">"${OUTPUTFILE}"
diff -c "${REFFILE}" "${OUTPUTFILE}" || exit 1
sort -d -o "${OUTPUTFILE}.sort" "${OUTPUTFILE}"
sort -d -o "${REFFILE}.sort" "${REFFILE}"
diff -c "${REFFILE}.sort" "${OUTPUTFILE}.sort" || exit 1
echo "${SUCCESS}"
cd "${DIRME}" || exit 1

View File

@ -0,0 +1,50 @@
CAPTION: 0
CHAT: ALL_ADMIN
CHAT: ALL_MEMBERS_ARE_ADMINISTRATORS
CHAT: FIRST_NAME Test
CHAT: ID 123456789
CHAT: LAST_NAME Bot
CHAT: TITLE BotTestTitle
CHAT: TYPE private
CHAT: USERNAME BotTest
CONTACT: FIRST_NAME ADAC
CONTACT: LAST_NAME Pannenhilfe
CONTACT: NUMBER 222222
CONTACT: USER_ID
CONTACT: VCARD BEGIN:VCARD\nVERSION:2.1\nN:Pannenhilfe;ADAC;;;\nFN:ADAC Pannenhilfe\nTEL;CELL;PREF:+49179222222\nTEL;X-Mobil:222222\nEND:VCARD
FORWARD: FIRST_NAME Kay
FORWARD: ID 6541
FORWARD: LAST_NAME M
FORWARD: UID 123456789
FORWARD: USERNAME Gnadelwartz
LOCATION: LATITUDE 49.631824
LOCATION: LONGITUDE 8.377072
MESSAGE: 0 😂😝👌☺❤😕😈#⃣🌏🎉🙊🙉☕🚀✈🚂💯✔〽🔚
MESSAGE: ID 6541
REPLYTO: 0 Ich bin der Deal-O-Mat Bot. Für eine Liste der Befehle sende /help
REPLYTO: FIRST_NAME dealzbot
REPLYTO: ID 6542
REPLYTO: LAST_NAME
REPLYTO: UID 987654321
REPLYTO: USERNAME Deal_O_Mat_bot
SERVICE: 0 yes
SERVICE: LEFTMEMBER 123456789
SERVICE: NEWMEMBER 123456789
SERVICE: NEWPHOTO
SERVICE: NEWTILE
SERVICE: PINNED
URLS: AUDIO audio-AgADAgADL6oxG-Gw4EndCWGl2WUfUo1pXw8ABOusSilDGzAYa
URLS: DOCUMENT document-AgADAgADL6oxG-Gw4EndCWGl2WUfUo1pXw8ABOusSilDGzAYa
URLS: PHOTO photo-AgADAgADL6oxG-Gw4EndCWGl2WUfUo1pXw8ABOusSilDGzAYa
URLS: STICKER sticker-AgADAgADL6oxG-Gw4EndCWGl2WUfUo1pXw8ABOusSilDGzAYa
URLS: VIDEO video-AgADAgADL6oxG-Gw4EndCWGl2WUfUo1pXw8ABOusSilDGzAYa
URLS: VOICE voice-AgADAgADL6oxG-Gw4EndCWGl2WUfUo1pXw8ABOusSilDGzAYa
USER: FIRST_NAME Kay
USER: ID 123456789
USER: LAST_NAME M
USER: USERNAME Gnadelwartz
VENUE: ADDRESS Am Rhein 1
VENUE: FOURSQUARE 4c4321afce54e21eee980d1a
VENUE: LATITUDE 49.631824
VENUE: LONGITUDE 8.377072
VENUE: TITLE Kolb's Biergarten