File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,18 @@ async fn test_404() {
4343 }
4444}
4545
46+ #[ actix_web:: test]
47+ async fn test_set_variable ( ) {
48+ let resp = req_path ( "/tests/test_set_variable.sql" ) . await . unwrap ( ) ;
49+ let body = test:: read_body ( resp) . await ;
50+ assert ! ( body. starts_with( b"<!DOCTYPE html>" ) ) ;
51+ // the body should contain the strint "It works!" and should not contain the string "error"
52+ let body = String :: from_utf8 ( body. to_vec ( ) ) . unwrap ( ) ;
53+ assert ! ( body. contains( "Hello John Doe !" ) , "{body}" ) ;
54+ assert ! ( body. contains( "How are you John Doe ?" ) , "{body}" ) ;
55+ assert ! ( !body. contains( "error" ) ) ;
56+ }
57+
4658async fn req_path ( path : & str ) -> Result < actix_web:: dev:: ServiceResponse , actix_web:: Error > {
4759 init_log ( ) ;
4860 let config = test_config ( ) ;
Original file line number Diff line number Diff line change 1+ set $person = ' John' || ' ' || ' Doe' ;
2+ select ' text' as component, ' Hello ' || $person || ' !' as contents;
3+ select ' text' as component, ' How are you ' || $person || ' ?' as contents;
You can’t perform that action at this time.
0 commit comments