File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -71,3 +71,13 @@ spacetime_publish() {
7171 set -e
7272 return " $RESULT_CODE "
7373}
74+
75+ fsed () {
76+ if [[ " $OSTYPE " == " darwin" * ]]; then
77+ sed -i.sed_bak " $@ "
78+ rm -f rm * .sed_bak
79+ else
80+ sed -i " $@ "
81+ fi
82+ }
83+
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ source "./test/lib.include"
1212do_test () {
1313 echo " RUNNING TEST FOR VALUE: $1 "
1414 create_project
15-
15+
1616 cat > " ${PROJECT_PATH} /src/lib.rs" << EOF
1717use spacetimedb::{println, spacetimedb};
1818
@@ -38,12 +38,12 @@ pub fn say_hello() {
3838}
3939EOF
4040
41- sed -i " s/REPLACE_VALUE/$1 /g" " ${PROJECT_PATH} /src/lib.rs"
42-
43- run_test cargo run publish --project-path " $PROJECT_PATH " --clear-database
41+ fsed " s/REPLACE_VALUE/$1 /g" " ${PROJECT_PATH} /src/lib.rs"
42+
43+ run_test cargo run publish --project-path " $PROJECT_PATH " --clear-database -d -s
4444 [ " 1" == " $( grep -c " reated new database" " $TEST_OUT " ) " ]
4545 IDENT=" $( grep " reated new database" " $TEST_OUT " | awk ' NF>1{print $NF}' ) "
46-
46+
4747 run_test cargo run call " $IDENT " add ' ["Robert", 1]'
4848 run_test cargo run call " $IDENT " add ' ["Julie", 2]'
4949 run_test cargo run call " $IDENT " add ' ["Samantha", 3]'
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ source "./test/lib.include"
1212do_test () {
1313 echo " RUNNING TEST FOR VALUE: $1 "
1414 create_project
15-
15+
1616 cat > " ${PROJECT_PATH} /src/lib.rs" << EOF
1717use spacetimedb::{println, spacetimedb};
1818
@@ -46,12 +46,12 @@ pub fn say_hello() {
4646}
4747EOF
4848
49- sed -i " s/REPLACE_VALUE/$1 /g" " ${PROJECT_PATH} /src/lib.rs"
50-
49+ fsed " s/REPLACE_VALUE/$1 /g" " ${PROJECT_PATH} /src/lib.rs"
50+
5151 run_test cargo run publish --project-path " $PROJECT_PATH " --clear-database
5252 [ " 1" == " $( grep -c " reated new database" " $TEST_OUT " ) " ]
5353 IDENT=" $( grep " reated new database" " $TEST_OUT " | awk ' NF>1{print $NF}' ) "
54-
54+
5555 run_test cargo run call " $IDENT " update ' ["Robert", 2]'
5656 run_test cargo run call " $IDENT " add_new ' ["Success"]'
5757 if run_test cargo run call " $IDENT " add_new ' ["Failure"]' ; then
You can’t perform that action at this time.
0 commit comments