Add some test data for validating program output.
This commit is contained in:
parent
41f00a5d58
commit
8ffc7660dd
27
test.sh
27
test.sh
@ -10,11 +10,34 @@ if [[ $DIR == "." ]]; then
|
||||
echo $DIR/$PROG
|
||||
fi
|
||||
|
||||
## Create User ##
|
||||
## Create Test User ##
|
||||
|
||||
# curl POST test_user test_password etc etc
|
||||
# insert into user values (-1, 'Hyperling', 'SuperSecretPassword')
|
||||
|
||||
## Create Entries ##
|
||||
|
||||
# Manually
|
||||
sqlite3 $DIR/db/main <<- EOF
|
||||
.headers on
|
||||
.echo on
|
||||
|
||||
delete from journal where user_id = -1;
|
||||
|
||||
insert into journal (user_id, cal_date, meal, food, caused_issue, comments)
|
||||
values (-1, '2023-03-22', 'Breakfast', 'Mango', '1', null);
|
||||
insert into journal (user_id, cal_date, meal, food, caused_issue, comments)
|
||||
values (-1, '2023-03-22', 'Lunch', 'Greasy restaurant food', '0', null);
|
||||
insert into journal (user_id, cal_date, meal, food, caused_issue, comments)
|
||||
values (-1, '2023-03-22', 'Snack', 'Rice and beans', '1', null);
|
||||
insert into journal (user_id, cal_date, meal, food, caused_issue, comments)
|
||||
values (-1, '2023-03-22', 'Dinner', 'Rice and beans', '1', null);
|
||||
|
||||
select * from journal where user_id = -1;
|
||||
EOF
|
||||
|
||||
## Via the API
|
||||
|
||||
# curl POST test_user 2023-03-07 "Mangoes and rice" FALSE "Yummy!"
|
||||
|
||||
## Remove any old test logs.
|
||||
rm -rfv $DIR/logs
|
||||
|
Reference in New Issue
Block a user