diff --git a/hx.hs b/hx.hs index 5c436ee..2cf3c75 100644 --- a/hx.hs +++ b/hx.hs @@ -558,7 +558,7 @@ mainArgs ("ec-int-modn":args) = interactArgsLn hx_ec_int_modn args mainArgs ("ec-x":args) = interactArgsLn hx_ec_x args mainArgs ("ec-y":args) = interactArgsLn hx_ec_y args -mainArgs ("mktx":file:args) = BS.writeFile (B8.unpack file) $ hx_mktx args +mainArgs ("mktx":file:args) = interactFileArgs hx_mktx file args mainArgs ["sign-input",f,i,s] = hx_sign_input f i s mainArgs ["set-input",f,i,s] = hx_set_input f i s mainArgs ["validsig",f,i,s,sig] = hx_validsig f i s sig diff --git a/tests/sx-tuto-mktx-stdin-stdout.t/TESTRECIPE b/tests/sx-tuto-mktx-stdin-stdout.t/TESTRECIPE new file mode 100644 index 0000000..cad6e99 --- /dev/null +++ b/tests/sx-tuto-mktx-stdin-stdout.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sx-tuto-mktx-stdin-stdout.t +command=hx +args=( mktx - --input 97e06e49dfdd26c5a904670971ccf4c7fe7d9da53cb379bf9b442fc9427080b3:1 --output - ) +exit_code=0 +stdin_file=stdin +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sx-tuto-mktx-stdin-stdout.t/stdin b/tests/sx-tuto-mktx-stdin-stdout.t/stdin new file mode 100644 index 0000000..7bd08d4 --- /dev/null +++ b/tests/sx-tuto-mktx-stdin-stdout.t/stdin @@ -0,0 +1 @@ +1MyKMeDsom7rYcp69KpbKn4DcyuvLMkLYJ:90000 diff --git a/tests/sx-tuto-mktx-stdin-stdout.t/stdout b/tests/sx-tuto-mktx-stdin-stdout.t/stdout new file mode 100644 index 0000000..e475bbc --- /dev/null +++ b/tests/sx-tuto-mktx-stdin-stdout.t/stdout @@ -0,0 +1 @@ +0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee0970100000000ffffffff01905f0100000000001976a914e60921dbfe1e066113f1c6e0ea15517234187d4788ac00000000 \ No newline at end of file diff --git a/tests/sx-tuto-mktx-stdout.t/TESTRECIPE b/tests/sx-tuto-mktx-stdout.t/TESTRECIPE new file mode 100644 index 0000000..735788d --- /dev/null +++ b/tests/sx-tuto-mktx-stdout.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sx-tuto-mktx-stdout.t +command=hx +args=( mktx - --input 97e06e49dfdd26c5a904670971ccf4c7fe7d9da53cb379bf9b442fc9427080b3:1 --output 1MyKMeDsom7rYcp69KpbKn4DcyuvLMkLYJ:90000 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sx-tuto-mktx-stdout.t/stdout b/tests/sx-tuto-mktx-stdout.t/stdout new file mode 100644 index 0000000..e475bbc --- /dev/null +++ b/tests/sx-tuto-mktx-stdout.t/stdout @@ -0,0 +1 @@ +0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee0970100000000ffffffff01905f0100000000001976a914e60921dbfe1e066113f1c6e0ea15517234187d4788ac00000000 \ No newline at end of file