diff --git a/latest b/latest index 937cd78..7becae1 100644 --- a/latest +++ b/latest @@ -1 +1 @@ -v0.3.1 +v0.3.2 diff --git a/sample/built-in/item.out.csv b/sample/built-in/item.out.csv index 8bfddad..054cdbe 100644 --- a/sample/built-in/item.out.csv +++ b/sample/built-in/item.out.csv @@ -1,8 +1,8 @@ id,type,RFSH_status,RFSH_good,RFSH_bad,RFSH_test_good,RFSH_test_bad -121003,story,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.I4lCUtSY""}",,, -8863,story,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.5E2sK6cU""}",,, -2921983,comment,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.z0NIf4DG""}",,, -192327,job,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.HvD3lSVM""}",,, -126809,poll,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.JffSRF96""}",,, -8863,failed-story,bad,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.RrZJnkTg""}",,,"Test ""Type failed-story"" failed . Expect failed-story. Actual story. +2921983,comment,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.BfosoZ1K""}",,, +8863,story,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.Ryiz6abM""}",,, +192327,job,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.6lxXXoMw""}",,, +121003,story,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.rsCSXFn4""}",,, +126809,poll,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.YDuGafkn""}",,, +8863,failed-story,bad,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.uzkYDT1g""}",,,"Test ""Type failed-story"" failed . Expect failed-story. Actual story. exit status 1" diff --git a/sample/coffee/get.dry.out.csv b/sample/coffee/get.dry.out.csv new file mode 100644 index 0000000..e0ede04 --- /dev/null +++ b/sample/coffee/get.dry.out.csv @@ -0,0 +1,631 @@ +0,RFSH_script,RFSH_test_script,RFSH_export_script +2,"#!/bin/bash +# +# RFSH built-in functions. +# Home: https://github.com/docsion/rfsh +# Version: #6ef1ee6 +# Ref: https://github.com/docsion/rfsh/blob/6ef1ee6/script/built_in.sh + +####################################### +# Check require command +# Arguments: +# Command, a string. +# More info url, a string. +# Returns: +# 0 if command exist, 1 on error. +####################################### +rf_require() { + cmd=$1 + more=$2 + if ! [ -x ""$(command -v ${cmd})"" ]; then + msg=""${cmd} is required."" + if [[ ! -z ""${more}"" ]]; then + msg=""${msg} More info: ${more}"" + fi + rf_err ${msg} + return 1 + fi +} + +####################################### +# Write log to stderror +# Arguments: +# Log to show, a string. +# Returns: +# Writes log to stderror, then return 1. +####################################### +rf_err() { + echo ""$*"" >&2 # print to stderr +} + +####################################### +# Assert equals between expected value and actual value +# Arguments: +# Test case name, a string. +# Expected value, any. +# Actual value, any. +# Returns: +# 0 if equals, 1 on error. +####################################### +rf_asserts() { + name=$1 + expect=$2 + actual=$3 + if [[ ! ""${expect}"" == ""${actual}"" ]]; + then + rf_err Test \""${name}\"" failed . Expect ""${expect}"". Actual ""${actual}."" + return 1 + fi +} + +####################################### +# Get $RESULT_IN +# Globals: +# RESULT_IN +# Arguments: +# RESULT_IN, a string. +# Returns: +# String if RESULT_IN exists, 1 on errors. +####################################### +rf_result_in() { + if [[ -z $RESULT_IN ]]; + then + rf_err ""RESULT_IN is required"" + return 1 + fi + + echo ""${RESULT_IN}"" +} + +####################################### +# Exec curl with -w ""%{json}"" +# Arguments: +# Curl request likes, a string +# Returns: +# Json -w ""%{json}"", a string. +# 1 on error. +####################################### +rf_curl() { + rf_require curl https://github.com/curl/curl \ + && curl -o $(mktemp) -s -w ""%{json}"" ""$@"" +} + +####################################### +# Exec http/https request, curl likes +# Arguments: +# Curl request likes, a string +# Returns: +# Json {response_code, response}. +# - response_code: http response status code, a number, e.g. 200 +# - response: response content file location, a string +# 1 on error. +####################################### +rf_http() { + rf_require jq https://github.com/jqlang/jq \ + && rf_curl ""$@"" \ + | jq -c '{""response_code"": .response_code} + {""response"": .filename_effective}' + + return_codes=( ""${PIPESTATUS[@]}"" ) + if (( return_codes[0] != 0 )); then + return ${return_codes[0]} + fi +} + +# +# Use built-in functions +# rf_http +# |- https://github.com/docsion/rfsh/blob/94c245d/script/built_in.sh#L97 + +# https://github.com/AlexFlipnote/CoffeeAPI +rf_http https://coffee.alexflipnote.dev/random.json +",,"# +# Use built-in functions +# rf_result_in +# |- https://github.com/docsion/rfsh/blob/b416f5c/script/built_in.sh#L67 +value=$(cat $(rf_result_in | jq -r '.good' | jq -r '.response') | jq -r '.file') +echo '{""file"": ""'$value'""}' +" +4,"#!/bin/bash +# +# RFSH built-in functions. +# Home: https://github.com/docsion/rfsh +# Version: #6ef1ee6 +# Ref: https://github.com/docsion/rfsh/blob/6ef1ee6/script/built_in.sh + +####################################### +# Check require command +# Arguments: +# Command, a string. +# More info url, a string. +# Returns: +# 0 if command exist, 1 on error. +####################################### +rf_require() { + cmd=$1 + more=$2 + if ! [ -x ""$(command -v ${cmd})"" ]; then + msg=""${cmd} is required."" + if [[ ! -z ""${more}"" ]]; then + msg=""${msg} More info: ${more}"" + fi + rf_err ${msg} + return 1 + fi +} + +####################################### +# Write log to stderror +# Arguments: +# Log to show, a string. +# Returns: +# Writes log to stderror, then return 1. +####################################### +rf_err() { + echo ""$*"" >&2 # print to stderr +} + +####################################### +# Assert equals between expected value and actual value +# Arguments: +# Test case name, a string. +# Expected value, any. +# Actual value, any. +# Returns: +# 0 if equals, 1 on error. +####################################### +rf_asserts() { + name=$1 + expect=$2 + actual=$3 + if [[ ! ""${expect}"" == ""${actual}"" ]]; + then + rf_err Test \""${name}\"" failed . Expect ""${expect}"". Actual ""${actual}."" + return 1 + fi +} + +####################################### +# Get $RESULT_IN +# Globals: +# RESULT_IN +# Arguments: +# RESULT_IN, a string. +# Returns: +# String if RESULT_IN exists, 1 on errors. +####################################### +rf_result_in() { + if [[ -z $RESULT_IN ]]; + then + rf_err ""RESULT_IN is required"" + return 1 + fi + + echo ""${RESULT_IN}"" +} + +####################################### +# Exec curl with -w ""%{json}"" +# Arguments: +# Curl request likes, a string +# Returns: +# Json -w ""%{json}"", a string. +# 1 on error. +####################################### +rf_curl() { + rf_require curl https://github.com/curl/curl \ + && curl -o $(mktemp) -s -w ""%{json}"" ""$@"" +} + +####################################### +# Exec http/https request, curl likes +# Arguments: +# Curl request likes, a string +# Returns: +# Json {response_code, response}. +# - response_code: http response status code, a number, e.g. 200 +# - response: response content file location, a string +# 1 on error. +####################################### +rf_http() { + rf_require jq https://github.com/jqlang/jq \ + && rf_curl ""$@"" \ + | jq -c '{""response_code"": .response_code} + {""response"": .filename_effective}' + + return_codes=( ""${PIPESTATUS[@]}"" ) + if (( return_codes[0] != 0 )); then + return ${return_codes[0]} + fi +} + +# +# Use built-in functions +# rf_http +# |- https://github.com/docsion/rfsh/blob/94c245d/script/built_in.sh#L97 + +# https://github.com/AlexFlipnote/CoffeeAPI +rf_http https://coffee.alexflipnote.dev/random.json +",,"# +# Use built-in functions +# rf_result_in +# |- https://github.com/docsion/rfsh/blob/b416f5c/script/built_in.sh#L67 +value=$(cat $(rf_result_in | jq -r '.good' | jq -r '.response') | jq -r '.file') +echo '{""file"": ""'$value'""}' +" +3,"#!/bin/bash +# +# RFSH built-in functions. +# Home: https://github.com/docsion/rfsh +# Version: #6ef1ee6 +# Ref: https://github.com/docsion/rfsh/blob/6ef1ee6/script/built_in.sh + +####################################### +# Check require command +# Arguments: +# Command, a string. +# More info url, a string. +# Returns: +# 0 if command exist, 1 on error. +####################################### +rf_require() { + cmd=$1 + more=$2 + if ! [ -x ""$(command -v ${cmd})"" ]; then + msg=""${cmd} is required."" + if [[ ! -z ""${more}"" ]]; then + msg=""${msg} More info: ${more}"" + fi + rf_err ${msg} + return 1 + fi +} + +####################################### +# Write log to stderror +# Arguments: +# Log to show, a string. +# Returns: +# Writes log to stderror, then return 1. +####################################### +rf_err() { + echo ""$*"" >&2 # print to stderr +} + +####################################### +# Assert equals between expected value and actual value +# Arguments: +# Test case name, a string. +# Expected value, any. +# Actual value, any. +# Returns: +# 0 if equals, 1 on error. +####################################### +rf_asserts() { + name=$1 + expect=$2 + actual=$3 + if [[ ! ""${expect}"" == ""${actual}"" ]]; + then + rf_err Test \""${name}\"" failed . Expect ""${expect}"". Actual ""${actual}."" + return 1 + fi +} + +####################################### +# Get $RESULT_IN +# Globals: +# RESULT_IN +# Arguments: +# RESULT_IN, a string. +# Returns: +# String if RESULT_IN exists, 1 on errors. +####################################### +rf_result_in() { + if [[ -z $RESULT_IN ]]; + then + rf_err ""RESULT_IN is required"" + return 1 + fi + + echo ""${RESULT_IN}"" +} + +####################################### +# Exec curl with -w ""%{json}"" +# Arguments: +# Curl request likes, a string +# Returns: +# Json -w ""%{json}"", a string. +# 1 on error. +####################################### +rf_curl() { + rf_require curl https://github.com/curl/curl \ + && curl -o $(mktemp) -s -w ""%{json}"" ""$@"" +} + +####################################### +# Exec http/https request, curl likes +# Arguments: +# Curl request likes, a string +# Returns: +# Json {response_code, response}. +# - response_code: http response status code, a number, e.g. 200 +# - response: response content file location, a string +# 1 on error. +####################################### +rf_http() { + rf_require jq https://github.com/jqlang/jq \ + && rf_curl ""$@"" \ + | jq -c '{""response_code"": .response_code} + {""response"": .filename_effective}' + + return_codes=( ""${PIPESTATUS[@]}"" ) + if (( return_codes[0] != 0 )); then + return ${return_codes[0]} + fi +} + +# +# Use built-in functions +# rf_http +# |- https://github.com/docsion/rfsh/blob/94c245d/script/built_in.sh#L97 + +# https://github.com/AlexFlipnote/CoffeeAPI +rf_http https://coffee.alexflipnote.dev/random.json +",,"# +# Use built-in functions +# rf_result_in +# |- https://github.com/docsion/rfsh/blob/b416f5c/script/built_in.sh#L67 +value=$(cat $(rf_result_in | jq -r '.good' | jq -r '.response') | jq -r '.file') +echo '{""file"": ""'$value'""}' +" +1,"#!/bin/bash +# +# RFSH built-in functions. +# Home: https://github.com/docsion/rfsh +# Version: #6ef1ee6 +# Ref: https://github.com/docsion/rfsh/blob/6ef1ee6/script/built_in.sh + +####################################### +# Check require command +# Arguments: +# Command, a string. +# More info url, a string. +# Returns: +# 0 if command exist, 1 on error. +####################################### +rf_require() { + cmd=$1 + more=$2 + if ! [ -x ""$(command -v ${cmd})"" ]; then + msg=""${cmd} is required."" + if [[ ! -z ""${more}"" ]]; then + msg=""${msg} More info: ${more}"" + fi + rf_err ${msg} + return 1 + fi +} + +####################################### +# Write log to stderror +# Arguments: +# Log to show, a string. +# Returns: +# Writes log to stderror, then return 1. +####################################### +rf_err() { + echo ""$*"" >&2 # print to stderr +} + +####################################### +# Assert equals between expected value and actual value +# Arguments: +# Test case name, a string. +# Expected value, any. +# Actual value, any. +# Returns: +# 0 if equals, 1 on error. +####################################### +rf_asserts() { + name=$1 + expect=$2 + actual=$3 + if [[ ! ""${expect}"" == ""${actual}"" ]]; + then + rf_err Test \""${name}\"" failed . Expect ""${expect}"". Actual ""${actual}."" + return 1 + fi +} + +####################################### +# Get $RESULT_IN +# Globals: +# RESULT_IN +# Arguments: +# RESULT_IN, a string. +# Returns: +# String if RESULT_IN exists, 1 on errors. +####################################### +rf_result_in() { + if [[ -z $RESULT_IN ]]; + then + rf_err ""RESULT_IN is required"" + return 1 + fi + + echo ""${RESULT_IN}"" +} + +####################################### +# Exec curl with -w ""%{json}"" +# Arguments: +# Curl request likes, a string +# Returns: +# Json -w ""%{json}"", a string. +# 1 on error. +####################################### +rf_curl() { + rf_require curl https://github.com/curl/curl \ + && curl -o $(mktemp) -s -w ""%{json}"" ""$@"" +} + +####################################### +# Exec http/https request, curl likes +# Arguments: +# Curl request likes, a string +# Returns: +# Json {response_code, response}. +# - response_code: http response status code, a number, e.g. 200 +# - response: response content file location, a string +# 1 on error. +####################################### +rf_http() { + rf_require jq https://github.com/jqlang/jq \ + && rf_curl ""$@"" \ + | jq -c '{""response_code"": .response_code} + {""response"": .filename_effective}' + + return_codes=( ""${PIPESTATUS[@]}"" ) + if (( return_codes[0] != 0 )); then + return ${return_codes[0]} + fi +} + +# +# Use built-in functions +# rf_http +# |- https://github.com/docsion/rfsh/blob/94c245d/script/built_in.sh#L97 + +# https://github.com/AlexFlipnote/CoffeeAPI +rf_http https://coffee.alexflipnote.dev/random.json +",,"# +# Use built-in functions +# rf_result_in +# |- https://github.com/docsion/rfsh/blob/b416f5c/script/built_in.sh#L67 +value=$(cat $(rf_result_in | jq -r '.good' | jq -r '.response') | jq -r '.file') +echo '{""file"": ""'$value'""}' +" +5,"#!/bin/bash +# +# RFSH built-in functions. +# Home: https://github.com/docsion/rfsh +# Version: #6ef1ee6 +# Ref: https://github.com/docsion/rfsh/blob/6ef1ee6/script/built_in.sh + +####################################### +# Check require command +# Arguments: +# Command, a string. +# More info url, a string. +# Returns: +# 0 if command exist, 1 on error. +####################################### +rf_require() { + cmd=$1 + more=$2 + if ! [ -x ""$(command -v ${cmd})"" ]; then + msg=""${cmd} is required."" + if [[ ! -z ""${more}"" ]]; then + msg=""${msg} More info: ${more}"" + fi + rf_err ${msg} + return 1 + fi +} + +####################################### +# Write log to stderror +# Arguments: +# Log to show, a string. +# Returns: +# Writes log to stderror, then return 1. +####################################### +rf_err() { + echo ""$*"" >&2 # print to stderr +} + +####################################### +# Assert equals between expected value and actual value +# Arguments: +# Test case name, a string. +# Expected value, any. +# Actual value, any. +# Returns: +# 0 if equals, 1 on error. +####################################### +rf_asserts() { + name=$1 + expect=$2 + actual=$3 + if [[ ! ""${expect}"" == ""${actual}"" ]]; + then + rf_err Test \""${name}\"" failed . Expect ""${expect}"". Actual ""${actual}."" + return 1 + fi +} + +####################################### +# Get $RESULT_IN +# Globals: +# RESULT_IN +# Arguments: +# RESULT_IN, a string. +# Returns: +# String if RESULT_IN exists, 1 on errors. +####################################### +rf_result_in() { + if [[ -z $RESULT_IN ]]; + then + rf_err ""RESULT_IN is required"" + return 1 + fi + + echo ""${RESULT_IN}"" +} + +####################################### +# Exec curl with -w ""%{json}"" +# Arguments: +# Curl request likes, a string +# Returns: +# Json -w ""%{json}"", a string. +# 1 on error. +####################################### +rf_curl() { + rf_require curl https://github.com/curl/curl \ + && curl -o $(mktemp) -s -w ""%{json}"" ""$@"" +} + +####################################### +# Exec http/https request, curl likes +# Arguments: +# Curl request likes, a string +# Returns: +# Json {response_code, response}. +# - response_code: http response status code, a number, e.g. 200 +# - response: response content file location, a string +# 1 on error. +####################################### +rf_http() { + rf_require jq https://github.com/jqlang/jq \ + && rf_curl ""$@"" \ + | jq -c '{""response_code"": .response_code} + {""response"": .filename_effective}' + + return_codes=( ""${PIPESTATUS[@]}"" ) + if (( return_codes[0] != 0 )); then + return ${return_codes[0]} + fi +} + +# +# Use built-in functions +# rf_http +# |- https://github.com/docsion/rfsh/blob/94c245d/script/built_in.sh#L97 + +# https://github.com/AlexFlipnote/CoffeeAPI +rf_http https://coffee.alexflipnote.dev/random.json +",,"# +# Use built-in functions +# rf_result_in +# |- https://github.com/docsion/rfsh/blob/b416f5c/script/built_in.sh#L67 +value=$(cat $(rf_result_in | jq -r '.good' | jq -r '.response') | jq -r '.file') +echo '{""file"": ""'$value'""}' +" diff --git a/sample/coffee/get.out.csv b/sample/coffee/get.out.csv index cb81a6b..d1cd636 100644 --- a/sample/coffee/get.out.csv +++ b/sample/coffee/get.out.csv @@ -1,6 +1,6 @@ 0,RFSH_status,RFSH_good,RFSH_bad,RFSH_test_good,RFSH_test_bad,RFSH_export_file -3,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.FOkFxc3O""}",,,,https://coffee.alexflipnote.dev/Tez8urMh3-Y_coffee.png -2,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.rKYcSd2w""}",,,,https://coffee.alexflipnote.dev/YnzCo5-Mr3U_coffee.png -1,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.7jfc7BQK""}",,,,https://coffee.alexflipnote.dev/HOSOOnmb6Xs_coffee.jpg -4,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.BLRsCviE""}",,,,https://coffee.alexflipnote.dev/6GEJ4iSqv7I_coffee.jpg -5,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.coGHpnuA""}",,,,https://coffee.alexflipnote.dev/i-uzIj7qoNk_coffee.jpg +1,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.HgIt1wiy""}",,,,https://coffee.alexflipnote.dev/vcqGrG-c300_coffee.png +3,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.jmmvnPVR""}",,,,https://coffee.alexflipnote.dev/ATHQ0xdoa3U_coffee.jpg +2,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.a65VLZ2M""}",,,,https://coffee.alexflipnote.dev/X2NMKN11W_Q_coffee.jpg +4,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.zfN9Q7Yv""}",,,,https://coffee.alexflipnote.dev/l4EYtp4p6mo_coffee.png +5,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.LfaomDXC""}",,,,https://coffee.alexflipnote.dev/JhqaHeCqL_c_coffee.png diff --git a/sample/hn/item.out.csv b/sample/hn/item.out.csv index fc2f7c4..a044572 100644 --- a/sample/hn/item.out.csv +++ b/sample/hn/item.out.csv @@ -1,8 +1,8 @@ id,type,RFSH_status,RFSH_good,RFSH_bad,RFSH_test_good,RFSH_test_bad -8863,story,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.PwOuuJgN""}",,, -121003,story,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.b733WkWl""}",,, -2921983,comment,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.V9jgUjAj""}",,, -192327,job,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.dMtwyJv4""}",,, -126809,poll,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.6mMnyg8H""}",,, -8863,failed-story,bad,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.m3oQpt0E""}",,,"Test ""Type failed-story"" failed . Expect failed-story. Actual story +121003,story,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.GhJ1P5z9""}",,, +8863,story,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.es3RAYII""}",,, +192327,job,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.MKBN3kPQ""}",,, +2921983,comment,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.FTsfaBNn""}",,, +8863,failed-story,bad,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.4My5BPOu""}",,,"Test ""Type failed-story"" failed . Expect failed-story. Actual story exit status 1" +126809,poll,good,"{""response_code"":200,""response"":""/var/folders/f7/nj7_1pc15mj0st_k9vyq2yl80000gn/T/tmp.54pbyYF2""}",,, diff --git a/sample/sample.out.csv b/sample/sample.out.csv index 8ff664f..6d11192 100644 --- a/sample/sample.out.csv +++ b/sample/sample.out.csv @@ -1,11 +1,11 @@ id,content,philosopher,RFSH_status,RFSH_good,RFSH_bad,RFSH_test_good,RFSH_test_bad -3,"All mankind... being all equal and independent, no one ought to harm another in his life, health, liberty or possessions",John Locke,good,"No. 3 ""All mankind... being all equal and independent, no one ought to harm another in his life, health, liberty or possessions"" - John Locke",,, 1,It does not matter how slowly you go as long as you do not stop,Confucius,good,"No. 1 ""It does not matter how slowly you go as long as you do not stop"" - Confucius",,, -4,"History repeats itself, first as tragedy, second as farce",Karl Marx,good,"No. 4 ""History repeats itself, first as tragedy, second as farce"" - Karl Marx",,, 2,"Quality is not an act, it is a habit",Aristotle,good,"No. 2 ""Quality is not an act, it is a habit"" - Aristotle",,, +3,"All mankind... being all equal and independent, no one ought to harm another in his life, health, liberty or possessions",John Locke,good,"No. 3 ""All mankind... being all equal and independent, no one ought to harm another in his life, health, liberty or possessions"" - John Locke",,, +4,"History repeats itself, first as tragedy, second as farce",Karl Marx,good,"No. 4 ""History repeats itself, first as tragedy, second as farce"" - Karl Marx",,, 5,"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts",Bertrand Russell,good,"No. 5 ""The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts"" - Bertrand Russell",,, -8,There is no greater tyranny than that which is perpetrated under the shield of the law and in the name of justice,Montesquieu,good,"No. 8 ""There is no greater tyranny than that which is perpetrated under the shield of the law and in the name of justice"" - Montesquieu",,, 6,"If you are lonely when you're alone, you are in bad company",Jean-Paul Sartre,good,"No. 6 ""If you are lonely when you're alone, you are in bad company"" - Jean-Paul Sartre",,, 7,All men's miseries derive from not being able to sit in a quiet room alone,Blaise Pascal,good,"No. 7 ""All men's miseries derive from not being able to sit in a quiet room alone"" - Blaise Pascal",,, +8,There is no greater tyranny than that which is perpetrated under the shield of the law and in the name of justice,Montesquieu,good,"No. 8 ""There is no greater tyranny than that which is perpetrated under the shield of the law and in the name of justice"" - Montesquieu",,, 9,Beauty in things exists in the mind which contemplates them,David Hume,good,"No. 9 ""Beauty in things exists in the mind which contemplates them"" - David Hume",,, 10,"Let come what comes, let go what goes. See what remains",Ramana Maharshi,good,"No. 10 ""Let come what comes, let go what goes. See what remains"" - Ramana Maharshi",,, diff --git a/test.sh b/test.sh index 524af63..d5077ee 100644 --- a/test.sh +++ b/test.sh @@ -75,3 +75,13 @@ echo echo $ runflow basic -t sample/sample.template -i sample/sample.csv -o sample/sample.out.csv --rate-limit 10,10 echo ${runflow} basic -t sample/sample.template -i sample/sample.csv -o sample/sample.out.csv --rate-limit 10,10 + +echo +echo "[*] Export with dry-run" +echo +echo "\$ echo \"0\\\n1\\\n2\\\n3\\\n4\\\n5\" | runflow basic -t sample/coffee/get.template.sh --export-template sample/coffee/export.template.sh -o sample/coffee/get.out.csv --dry-run" +echo +echo "0\n1\n2\n3\n4\n5" \ + | ${runflow} basic -t sample/coffee/get.template.sh --export-template sample/coffee/export.template.sh -o sample/coffee/get.dry.out.csv --dry-run \ + && echo "sample/coffee/get.out.csv" \ + && mlr --icsv --opprint cut -f 0,RFSH_script,RFSH_test_script,RFSH_export_script sample/coffee/get.dry.out.csv