File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,12 @@ async fn test_csv_upload() -> actix_web::Result<()> {
119119 . insert_header ( ( "content-type" , "multipart/form-data; boundary=1234567890" ) )
120120 . set_payload (
121121 "--1234567890\r \n \
122- Content-Disposition: form-data; name=\" prices_file \" ; filename=\" prices .csv\" \r \n \
122+ Content-Disposition: form-data; name=\" people_file \" ; filename=\" people .csv\" \r \n \
123123 Content-Type: text/csv\r \n \
124124 \r \n \
125- price,quantity \r \n \
126- 1,5 \r \n \
127- 2.5,4 \r \n \
125+ name,age \r \n \
126+ Ophir,29 \r \n \
127+ Max,99 \r \n \
128128 --1234567890--\r \n ",
129129 )
130130 . to_srv_request ( ) ;
@@ -134,8 +134,8 @@ async fn test_csv_upload() -> actix_web::Result<()> {
134134 let body = test:: read_body ( resp) . await ;
135135 let body_str = String :: from_utf8 ( body. to_vec ( ) ) . unwrap ( ) ;
136136 assert ! (
137- body_str. contains( "total: 15 " ) ,
138- "{body_str}\n expected to contain: total: 15 "
137+ body_str. contains( "Ophir is 29 years old " ) ,
138+ "{body_str}\n expected to contain: Ophir is 29 years old "
139139 ) ;
140140 Ok ( ( ) )
141141}
Original file line number Diff line number Diff line change 1- create table bill (quantity text , price text );
2- copy bill(quantity, price ) from ' prices_file ' with (format csv, header true);
1+ create table people (name text , age text );
2+ copy people(name, age ) from ' people_file ' with (format csv, header true);
33select ' text' as component,
4- ' total: ' || sum (cast(quantity as float) * cast(price as float)) as contents
5- from bill ;
4+ name || ' is ' || age || ' years old. ' as contents
5+ from people ;
You can’t perform that action at this time.
0 commit comments