Change-Id: I80c9ae848873742a0521e6c4aa29c8f8d138bb69
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
--- /dev/null
+#!/usr/bin/env bats
+
+. ./tct/common.sh
+
+@test "no arguments" {
+ RES="$(die 2>&1)" || RET="$?"
+ [ -z "$RES" ]
+ [ "$RET" -eq 1 ]
+}
+
+@test "1st argument" {
+ RES="$(die "foo" 2>&1)" || RET="$?"
+ [ "$RES" = "foo" ]
+ [ "$RET" -eq 1 ]
+}
+
+@test "2nd argument" {
+ RES="$(die "" 2)" || RET="$?"
+ [ -z "$RES" ]
+ [ "$RET" -eq 2 ]
+}
+
+@test "both arguments" {
+ RES="$(die "foo" 3 2>&1)" || RET="$?"
+ [ "$RES" = "foo" ]
+ [ "$RET" -eq 3 ]
+}