File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 45
45
# loop through each object
46
46
jq -c ' .[]' <<< " $cases" | while read -r case ; do
47
47
desc=$( echo " $case " | jq ' .description' | tr ' [:upper:]' ' [:lower:]' | tr ' ' ' _' | tr -cd ' [:alnum:]_' | sed ' s/^/test_/' )
48
- input=$( echo " $case " | jq ' .input' )
49
- expected=$( echo " $case " | jq ' .expected' )
48
+ input=$( echo " $case " | jq -c ' .input' )
49
+ expected=$( echo " $case " | jq -c ' .expected' )
50
50
51
51
# append each test fn to the test file
52
52
cat << EOT >>"$test_file "
53
53
#[test] $( [[ " $first_iteration " == false ]] && printf " \n#[ignore]" )
54
54
fn ${desc} () {
55
- /*
56
- Input:
57
- ${input}
58
55
59
- Expected output:
60
- ${expected}
61
- */
56
+ let input = ${input} ;
57
+ let expected = ${expected} ;
62
58
63
59
// TODO: Add assertion
64
- assert_eq!(1, 1 )
60
+ assert_eq!(input, expected )
65
61
}
66
62
67
63
EOT
@@ -77,7 +73,7 @@ function create_lib_rs_template() {
77
73
local slug=$2
78
74
cat << EOT >"${exercise_dir} /src/lib.rs"
79
75
fn $( dash_to_underscore " $slug " ) () {
80
- unimplemented!("implement " $ slug" exercise")
76
+ unimplemented!("implement ${ slug} exercise")
81
77
}
82
78
EOT
83
79
message " success" " Stub file for lib.rs has been created!"
You can’t perform that action at this time.
0 commit comments