vanikam/utils/web_handler_test_generator.sh

28 lines
349 B
Bash
Executable file

#!/bin/bash
help() {
echo "Usage: web_test_generator.sh <domain name> <handler route>"
}
run() {
echo "
#[actix_rt::test]
async fn $1_web_$2_ui_works() {
let routes = RoutesRepository::default();
page_test_runner( &routes.$2).await;
}"
}
if [ -z $1 ]
then
help
elif [ -z $2 ]
then
help
else
run $1 $2 | wl-copy
run $1 $2
fi