#!/bin/sh

# Stops the execution, if a command has an error 
set -e

# Defines expected results
EXPECTED=$(cat <<'EOF'
Unix Seconds: 2021-09-19 07:24:36.000000 UTC
Unix Milliseconds: 2021-09-19 07:24:59.334000 UTC
EOF
)

# Run time-decode to decode unix epoch in secs and millis
ACTUAL=$(time-decode --unix 1632036276 --umil 1632036299334)

if [ "$ACTUAL" = "$EXPECTED" ]; then
    exit 0
fi

exit 1
