start 0.7 dev2, add JSON.sh test

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-04-22 20:34:43 +02:00
parent 4fff4c3319
commit f59ddae610
37 changed files with 283 additions and 50 deletions

4
.gitignore vendored
View File

@ -1,7 +1,9 @@
*~
/.github/
/count
/token
*.save
*.log
/JSON.sh/*
/JSON.sh/
/tmp-bot-bash/
/dist/

View File

@ -20,11 +20,11 @@ Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Do
1. Go to the directory you want to install bashbot, e.g.
* your $HOME directory (install and run with your user-ID)
* /usr/local if you want to run as service
2. [Download latest release](https://github.com/topkecleon/telegram-bot-bash/releases) archive from github and extract all files.
2. [Download latest release zip from github](https://github.com/topkecleon/telegram-bot-bash/releases) and extract all files.
As an alternative you can clone the github repository to get the latest, but possible unstable improvements.
As an alternative you can clone the github repository to get the latest improvements, run All-tests.sh to be shure.
```
git clone https://github.com/topkecleon/telegram-bot-bash
git clone https://github.com/topkecleon/telegram-bot-bash; test/ALL-tests.sh
```
3. Go to directory ```telegram-bot-bash```, run ```./bashbot.sh init``` and follow the instructions. At this point you are asked for your Bots token given by botfather.
@ -102,4 +102,4 @@ Bashbot is not more (in)secure as any other Bot written in any other language, w
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3

View File

@ -31,13 +31,13 @@ Install bashbot
* your $HOME directory (install and run with your user-ID)
* /usr/local if you want to run as service
2. https://github.com/topkecleon/telegram-bot-bash/releases[Download
latest release] archive from github and extract all files.
latest release zip from github] and extract all files.
+
As an alternative you can clone the github repository to get the latest,
but possible unstable improvements.
As an alternative you can clone the github repository to get the latest
improvements, run All-tests.sh to be shure.
+
....
git clone https://github.com/topkecleon/telegram-bot-bash
git clone https://github.com/topkecleon/telegram-bot-bash; test/ALL-tests.sh
....
3. Go to directory `telegram-bot-bash`, run `./bashbot.sh init` and
follow the instructions. At this point you are asked for your Bots token
@ -166,5 +166,5 @@ That's it!
If you feel that there's something missing or if you found a bug, feel
free to submit a pull request!
latexmath:[\[VERSION\]] v0.62-0-g5d5dbae
++++++++++++++++++++++++++++++++++++++++
latexmath:[\[VERSION\]] v0.70-dev2-0-g4fff4c3
+++++++++++++++++++++++++++++++++++++++++++++

View File

@ -1,7 +1,7 @@
#!/bin/sh
# description: Start or stop telegram-bash-bot
#
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# shellcheck disable=SC2009
# shellcheck disable=SC2181

View File

@ -10,7 +10,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.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
#
# Exit Codes:
# - 0 sucess (hopefully)

View File

@ -4,7 +4,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.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
#
# shellcheck disable=SC2154
# shellcheck disable=SC2034

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script
@ -8,13 +8,11 @@ cd "$GIT_DIR/.." || exit 1
export HOOKDIR="dev/hooks"
echo "Running pre-commit hook"
# if any command inside script returns error, exit and return that error
set -e
# let's fake failing test for now
echo "Running tests"
echo "Running pre-commit hook"
echo "............................"
unset IFS; set -f
@ -29,7 +27,7 @@ fi
# run shellcheck before commit
set +f
FILES="$(find ./* -name '*.sh')"
FILES="$(find ./* -name '*.sh' | grep -v 'dist\/' )"
set -f
FILES="${FILES} $(sed '/^#/d' <"dev/shellcheck.files")"
if [ "$FILES" != "" ]; then

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script
@ -11,13 +11,11 @@ export HOOKDIR="dev/hooks"
REMOTEVER="$(git ls-remote -t --refs 2>/dev/null | tail -1 | sed 's/.*\/v//')"
VERSION="$(git describe --tags | sed -e 's/-.*//' -e 's/v//')"
echo "Running pre-push hook"
# if any command inside script returns error, exit and return that error
set -e
# let's fake failing test for now
echo "Running tests"
echo "Running pre-push hook"
echo "............................"
unset IFS; set -f
@ -25,7 +23,9 @@ unset IFS; set -f
# LOCAL version must greater than latest REMOTE release version
if (( $(echo "${VERSION} > ${REMOTEVER}" | bc -l) )); then
# update version in bashbot files on push
dev/version.sh 2>/dev/null
echo -n " "
dev/version.sh 2>/dev/null || exit 1
echo " OK"
else
echo "Error: local version ${VERSION} must be greater than latest release version."
echo "use \"git tag ...\" to create a local version greater than ${REMOTEVER}"

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# this has to run once atfer git clone
# and every time we create new hooks
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script

56
dev/make-dist.sh Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env bash
# this has to run once atfer git clone
# and every time we create new hooks
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script
GIT_DIR=$(git rev-parse --git-dir)
cd "$GIT_DIR/.." || exit 1
VERSION="$(git describe --tags | sed -e 's/-.*//' -e 's/v//')"
DISTNAME="telegram-bot-bash"
DISTDIR="./dist/${DISTNAME}"
DISTFILES="bashbot.rc bashbot.sh commands.sh doc examples LICENSE README.md README.txt"
# run tests first!
for test in dev/hooks/* "test/ALL-tests.sh"
do
if ! "${test}" ; then
echo "Test ${test} failed, can't create dist!"
exit 1
fi
done
# create dir for sitribution and copy files
mkdir -p "${DISTDIR}" 2>/dev/null
# shellcheck disable=SC2086
cp -r ${DISTFILES} "${DISTDIR}"
cd "${DISTDIR}" || exit 1
# additional stuff
mv "commands.sh" "commands.sh.dist"
JSONSHFILE="JSON.sh/JSON.sh"
if [ ! -f "${JSONSHFILE}" ]; then
mkdir "JSON.sh" 2>/dev/null;
curl -sL -o "${JSONSHFILE}" "https://cdn.jsdelivr.net/gh/dominictarr/JSON.sh/JSON.sh"
chmod +x "${JSONSHFILE}"
fi
# create archive
cd .. || exit 1
zip -rq "${DISTNAME}-${VERSION}.zip" "${DISTNAME}"
tar -czf "${DISTNAME}-${VERSION}.tar.gz" "${DISTNAME}"
# shellcheck disable=SC2086
ls -ld ${DISTNAME}-${VERSION}.*
# remove temporary dist dir
cd "$GIT_DIR/.." || exit 1
rm -rf ${DISTDIR}

View File

@ -1,3 +1,3 @@
# list of additional files to check from shellcheck
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
bashbot.rc

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# shellcheck disable=SC2016
#
# Easy Versioning in git:

View File

@ -61,5 +61,5 @@ group. This step is up to you actually.
#### [Next Getting started](2_usage.md)
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3

View File

@ -159,5 +159,5 @@ send_action "${CHAT[ID]}" "action"
#### [Prev Create Bot](1_firstbot.md)
#### [Next Advanced Usage](3_advanced.md)
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3

View File

@ -156,5 +156,5 @@ answer_inline_query "$iQUERY_ID" "cached_sticker" "identifier for the sticker"
#### [Prev Advanced Usage](3_advanced.md)
#### [Next Expert Use](4_expert.md)
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3

View File

@ -104,5 +104,5 @@ An example crontab is provided in ```examples/bashbot.cron```.
#### [Prev Expert Use](4_expert.md)
#### [Next Best Practice](5_practice.md)
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3

View File

@ -112,5 +112,5 @@ The second warning is about an unused variable, this is true because in our exam
#### [Prev Best Practice](5_practice.md)
#### [Next Functions Reference](6_reference.md)
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3

View File

@ -348,5 +348,5 @@ Send Input from Telegram to waiting Interactive Chat.
#### [Prev Best Practice](5_practice.md)
#### [Next Developer Rules](7_develop.md)
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3

View File

@ -70,5 +70,5 @@ fi
#### [Prev Function Reference](6_function.md)
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3

View File

@ -7,7 +7,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.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
SHELL=/bin/sh

View File

@ -3,7 +3,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.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -2,7 +2,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.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -3,7 +3,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.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -3,7 +3,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.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# common variables
export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME
@ -23,6 +23,7 @@ export SUCCESS NOSUCCESS
NOSUCCESS=" FAILED!"
# default input, reference and output files
export INPUTFILE REFFILE OUTPUTFILE
INPUTFILE="${DIRME}/${REFDIR}/${REFDIR}.input"
REFFILE="${DIRME}/${REFDIR}/${REFDIR}.result"
OUTPUTFILE="${TESTDIR}/${REFDIR}.out"
@ -34,7 +35,7 @@ print_array() {
for idx in "${arrays[@]}"; do
declare -n temp="$idx"
for t in "${!temp[@]}"; do
printf "%s:\t%s\t%s\n" "$idx" "$t" "${temp[$t]}"
printf '%s:\t%s\t%s\n' "$idx" "$t" "${temp[$t]}"
done | sort
done | grep -v '^USER: 0'
}

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# this has to run once atfer git clone
# and every time we create new hooks
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script
@ -11,7 +11,7 @@ cd "${GIT_DIR}/.." || exit 1
# create test environment
TESTENV="/tmp/bashbot.test$$"
mkdir "${TESTENV}"
cp -r * "${TESTENV}"
cp -r ./* "${TESTENV}"
cd "test" || exit 1
#set -e
@ -20,7 +20,7 @@ tests=0
passed=0
#all_tests=${__dirname:}
#echo PLAN ${#all_tests}
for test in $(find ./${pass}*-test.sh | sort -u) ;
for test in $(find ./*-test.sh | sort -u) ;
do
[ "${test}" = "test/all-tests.sh" ] && continue
[ ! -x "${test}" ] && continue

2
test/a-commit-test.sh Normal file → Executable file
View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
../dev/hooks/pre-commit.sh

2
test/a-push-test.sh Normal file → Executable file
View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
../dev/hooks/pre-push.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh

35
test/d-JSON.sh-test.sh Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh
source "./ALL-tests.inc.sh"
set -e
# source bashbot.sh functionw
cd "${TESTDIR}" || exit 1
# run JSON.sh with and without options
cd "test" || exit 1
echo "Check JSON.sh ..."
JSON="../JSON.sh/JSON.sh"
for i in 1 2
do
[ "${i}" = "1" ] && echo " ... JSON.sh -s -b -n"
[ "${i}" = "2" ] && echo " ... JSON.sh"
set +f
for jsonfile in ${REFDIR}/*.log
do
set -f
[ "${i}" = "1" ] && "${JSON}" -s -b -n <"${jsonfile}" >"${jsonfile}.out-${i}"
[ "${i}" = "2" ] && "${JSON}" <"${jsonfile}" >"${jsonfile}.out-${i}"
# output processed input
diff -c "${jsonfile}.result-${i}" "${jsonfile}.out-${i}" || exit 1
done
echo "${SUCCESS}"
done
cd "${DIRME}" || exit 1

View File

@ -0,0 +1,22 @@
["ok"] true
["result",0,"update_id"] 146860898
["result",0,"message","message_id"] 6620
["result",0,"message","from","id"] 123456789
["result",0,"message","from","is_bot"] false
["result",0,"message","from","first_name"] "Kay"
["result",0,"message","from","last_name"] "M"
["result",0,"message","from","username"] "Gnadelwartz"
["result",0,"message","from","language_code"] "de"
["result",0,"message","chat","id"] 123456789
["result",0,"message","chat","first_name"] "Kay"
["result",0,"message","chat","last_name"] "M"
["result",0,"message","chat","username"] "Gnadelwartz"
["result",0,"message","chat","type"] "private"
["result",0,"message","date"] 1555934213
["result",0,"message","location","latitude"] 49.630443
["result",0,"message","location","longitude"] 8.361698
["result",0,"message","venue","location","latitude"] 49.630443
["result",0,"message","venue","location","longitude"] 8.361698
["result",0,"message","venue","title"] "Vannini"
["result",0,"message","venue","address"] "K\u00e4mmererstr. 3"
["result",0,"message","venue","foursquare_id"] "4bf94ec05ec320a115f889d3"

View File

@ -0,0 +1,31 @@
["ok"] true
["result",0,"update_id"] 146860898
["result",0,"message","message_id"] 6620
["result",0,"message","from","id"] 123456789
["result",0,"message","from","is_bot"] false
["result",0,"message","from","first_name"] "Kay"
["result",0,"message","from","last_name"] "M"
["result",0,"message","from","username"] "Gnadelwartz"
["result",0,"message","from","language_code"] "de"
["result",0,"message","from"] {"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"}
["result",0,"message","chat","id"] 123456789
["result",0,"message","chat","first_name"] "Kay"
["result",0,"message","chat","last_name"] "M"
["result",0,"message","chat","username"] "Gnadelwartz"
["result",0,"message","chat","type"] "private"
["result",0,"message","chat"] {"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"}
["result",0,"message","date"] 1555934213
["result",0,"message","location","latitude"] 49.630443
["result",0,"message","location","longitude"] 8.361698
["result",0,"message","location"] {"latitude":49.630443,"longitude":8.361698}
["result",0,"message","venue","location","latitude"] 49.630443
["result",0,"message","venue","location","longitude"] 8.361698
["result",0,"message","venue","location"] {"latitude":49.630443,"longitude":8.361698}
["result",0,"message","venue","title"] "Vannini"
["result",0,"message","venue","address"] "K\u00e4mmererstr. 3"
["result",0,"message","venue","foursquare_id"] "4bf94ec05ec320a115f889d3"
["result",0,"message","venue"] {"location":{"latitude":49.630443,"longitude":8.361698},"title":"Vannini","address":"K\u00e4mmererstr. 3","foursquare_id":"4bf94ec05ec320a115f889d3"}
["result",0,"message"] {"message_id":6620,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934213,"location":{"latitude":49.630443,"longitude":8.361698},"venue":{"location":{"latitude":49.630443,"longitude":8.361698},"title":"Vannini","address":"K\u00e4mmererstr. 3","foursquare_id":"4bf94ec05ec320a115f889d3"}}
["result",0] {"update_id":146860898,"message":{"message_id":6620,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934213,"location":{"latitude":49.630443,"longitude":8.361698},"venue":{"location":{"latitude":49.630443,"longitude":8.361698},"title":"Vannini","address":"K\u00e4mmererstr. 3","foursquare_id":"4bf94ec05ec320a115f889d3"}}}
["result"] [{"update_id":146860898,"message":{"message_id":6620,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934213,"location":{"latitude":49.630443,"longitude":8.361698},"venue":{"location":{"latitude":49.630443,"longitude":8.361698},"title":"Vannini","address":"K\u00e4mmererstr. 3","foursquare_id":"4bf94ec05ec320a115f889d3"}}}]
[] {"ok":true,"result":[{"update_id":146860898,"message":{"message_id":6620,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934213,"location":{"latitude":49.630443,"longitude":8.361698},"venue":{"location":{"latitude":49.630443,"longitude":8.361698},"title":"Vannini","address":"K\u00e4mmererstr. 3","foursquare_id":"4bf94ec05ec320a115f889d3"}}}]}

View File

@ -0,0 +1,19 @@
["ok"] true
["result",0,"update_id"] 146860896
["result",0,"message","message_id"] 6618
["result",0,"message","from","id"] 123456789
["result",0,"message","from","is_bot"] false
["result",0,"message","from","first_name"] "Kay"
["result",0,"message","from","last_name"] "M"
["result",0,"message","from","username"] "Gnadelwartz"
["result",0,"message","from","language_code"] "de"
["result",0,"message","chat","id"] 123456789
["result",0,"message","chat","first_name"] "Kay"
["result",0,"message","chat","last_name"] "M"
["result",0,"message","chat","username"] "Gnadelwartz"
["result",0,"message","chat","type"] "private"
["result",0,"message","date"] 1555934195
["result",0,"message","voice","duration"] 1
["result",0,"message","voice","mime_type"] "audio/ogg"
["result",0,"message","voice","file_id"] "AwADAgADKQMAAh638UnbhHGzIMozZgI"
["result",0,"message","voice","file_size"] 3963

View File

@ -0,0 +1,26 @@
["ok"] true
["result",0,"update_id"] 146860896
["result",0,"message","message_id"] 6618
["result",0,"message","from","id"] 123456789
["result",0,"message","from","is_bot"] false
["result",0,"message","from","first_name"] "Kay"
["result",0,"message","from","last_name"] "M"
["result",0,"message","from","username"] "Gnadelwartz"
["result",0,"message","from","language_code"] "de"
["result",0,"message","from"] {"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"}
["result",0,"message","chat","id"] 123456789
["result",0,"message","chat","first_name"] "Kay"
["result",0,"message","chat","last_name"] "M"
["result",0,"message","chat","username"] "Gnadelwartz"
["result",0,"message","chat","type"] "private"
["result",0,"message","chat"] {"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"}
["result",0,"message","date"] 1555934195
["result",0,"message","voice","duration"] 1
["result",0,"message","voice","mime_type"] "audio/ogg"
["result",0,"message","voice","file_id"] "AwADAgADKQMAAh638UnbhHGzIMozZgI"
["result",0,"message","voice","file_size"] 3963
["result",0,"message","voice"] {"duration":1,"mime_type":"audio/ogg","file_id":"AwADAgADKQMAAh638UnbhHGzIMozZgI","file_size":3963}
["result",0,"message"] {"message_id":6618,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934195,"voice":{"duration":1,"mime_type":"audio/ogg","file_id":"AwADAgADKQMAAh638UnbhHGzIMozZgI","file_size":3963}}
["result",0] {"update_id":146860896,"message":{"message_id":6618,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934195,"voice":{"duration":1,"mime_type":"audio/ogg","file_id":"AwADAgADKQMAAh638UnbhHGzIMozZgI","file_size":3963}}}
["result"] [{"update_id":146860896,"message":{"message_id":6618,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934195,"voice":{"duration":1,"mime_type":"audio/ogg","file_id":"AwADAgADKQMAAh638UnbhHGzIMozZgI","file_size":3963}}}]
[] {"ok":true,"result":[{"update_id":146860896,"message":{"message_id":6618,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":123456789,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934195,"voice":{"duration":1,"mime_type":"audio/ogg","file_id":"AwADAgADKQMAAh638UnbhHGzIMozZgI","file_size":3963}}}]}

View File

@ -0,0 +1,18 @@
["ok"] true
["result",0,"update_id"] 146860897
["result",0,"message","message_id"] 6619
["result",0,"message","from","id"] 123456789
["result",0,"message","from","is_bot"] false
["result",0,"message","from","first_name"] "Kay"
["result",0,"message","from","last_name"] "M"
["result",0,"message","from","username"] "Gnadelwartz"
["result",0,"message","from","language_code"] "de"
["result",0,"message","chat","id"] 586928566
["result",0,"message","chat","first_name"] "Kay"
["result",0,"message","chat","last_name"] "M"
["result",0,"message","chat","username"] "Gnadelwartz"
["result",0,"message","chat","type"] "private"
["result",0,"message","date"] 1555934204
["result",0,"message","contact","phone_number"] "222222"
["result",0,"message","contact","first_name"] "ADAC Pannenhilfe"
["result",0,"message","contact","vcard"] "BEGIN:VCARD\nVERSION:2.1\nN:Pannenhilfe;ADAC;;;\nFN:ADAC Pannenhilfe\nTEL;CELL;PREF:+49179222222\nTEL;X-Mobil:222222\nEND:VCARD"

View File

@ -0,0 +1,25 @@
["ok"] true
["result",0,"update_id"] 146860897
["result",0,"message","message_id"] 6619
["result",0,"message","from","id"] 123456789
["result",0,"message","from","is_bot"] false
["result",0,"message","from","first_name"] "Kay"
["result",0,"message","from","last_name"] "M"
["result",0,"message","from","username"] "Gnadelwartz"
["result",0,"message","from","language_code"] "de"
["result",0,"message","from"] {"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"}
["result",0,"message","chat","id"] 586928566
["result",0,"message","chat","first_name"] "Kay"
["result",0,"message","chat","last_name"] "M"
["result",0,"message","chat","username"] "Gnadelwartz"
["result",0,"message","chat","type"] "private"
["result",0,"message","chat"] {"id":586928566,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"}
["result",0,"message","date"] 1555934204
["result",0,"message","contact","phone_number"] "222222"
["result",0,"message","contact","first_name"] "ADAC Pannenhilfe"
["result",0,"message","contact","vcard"] "BEGIN:VCARD\nVERSION:2.1\nN:Pannenhilfe;ADAC;;;\nFN:ADAC Pannenhilfe\nTEL;CELL;PREF:+49179222222\nTEL;X-Mobil:222222\nEND:VCARD"
["result",0,"message","contact"] {"phone_number":"222222","first_name":"ADAC Pannenhilfe","vcard":"BEGIN:VCARD\nVERSION:2.1\nN:Pannenhilfe;ADAC;;;\nFN:ADAC Pannenhilfe\nTEL;CELL;PREF:+49179222222\nTEL;X-Mobil:222222\nEND:VCARD"}
["result",0,"message"] {"message_id":6619,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":586928566,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934204,"contact":{"phone_number":"222222","first_name":"ADAC Pannenhilfe","vcard":"BEGIN:VCARD\nVERSION:2.1\nN:Pannenhilfe;ADAC;;;\nFN:ADAC Pannenhilfe\nTEL;CELL;PREF:+49179222222\nTEL;X-Mobil:222222\nEND:VCARD"}}
["result",0] {"update_id":146860897,"message":{"message_id":6619,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":586928566,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934204,"contact":{"phone_number":"222222","first_name":"ADAC Pannenhilfe","vcard":"BEGIN:VCARD\nVERSION:2.1\nN:Pannenhilfe;ADAC;;;\nFN:ADAC Pannenhilfe\nTEL;CELL;PREF:+49179222222\nTEL;X-Mobil:222222\nEND:VCARD"}}}
["result"] [{"update_id":146860897,"message":{"message_id":6619,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":586928566,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934204,"contact":{"phone_number":"222222","first_name":"ADAC Pannenhilfe","vcard":"BEGIN:VCARD\nVERSION:2.1\nN:Pannenhilfe;ADAC;;;\nFN:ADAC Pannenhilfe\nTEL;CELL;PREF:+49179222222\nTEL;X-Mobil:222222\nEND:VCARD"}}}]
[] {"ok":true,"result":[{"update_id":146860897,"message":{"message_id":6619,"from":{"id":123456789,"is_bot":false,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","language_code":"de"},"chat":{"id":586928566,"first_name":"Kay","last_name":"M","username":"Gnadelwartz","type":"private"},"date":1555934204,"contact":{"phone_number":"222222","first_name":"ADAC Pannenhilfe","vcard":"BEGIN:VCARD\nVERSION:2.1\nN:Pannenhilfe;ADAC;;;\nFN:ADAC Pannenhilfe\nTEL;CELL;PREF:+49179222222\nTEL;X-Mobil:222222\nEND:VCARD"}}}]}

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v0.62-0-g5d5dbae
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh