Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the tests with OCaml 5.2 #37

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 53 additions & 53 deletions test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,50 +29,50 @@ let parser ~emitters =
* echo "<!DOCTYPE html><title>Content of a.html.</title>" > a.html
* curl -F "text=default" -F "[email protected]" -F "[email protected]" localhost:8000 *)
let simple =
{html|Host: localhost:8000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 489
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------eb790219f130e103
--------------------------eb790219f130e103
Content-Disposition: form-data; name="text"
default
--------------------------eb790219f130e103
Content-Disposition: form-data; name="file1"; filename="a.html"
Content-Type: text/html
{html|Host: localhost:8000|html}^"\r"^{html|
User-Agent: curl/7.47.0|html}^"\r"^{html|
Accept: */*|html}^"\r"^{html|
Content-Length: 489|html}^"\r"^{html|
Expect: 100-continue|html}^"\r"^{html|
Content-Type: multipart/form-data; boundary=------------------------eb790219f130e103|html}^"\r"^{html|
|html}^"\r"^{html|
--------------------------eb790219f130e103|html}^"\r"^{html|
Content-Disposition: form-data; name="text"|html}^"\r"^{html|
|html}^"\r"^{html|
default|html}^"\r"^{html|
--------------------------eb790219f130e103|html}^"\r"^{html|
Content-Disposition: form-data; name="file1"; filename="a.html"|html}^"\r"^{html|
Content-Type: text/html|html}^"\r"^{html|
|html}^"\r"^{html|
<!DOCTYPE html><title>Content of a.html.</title>
--------------------------eb790219f130e103
Content-Disposition: form-data; name="file2"; filename="a.txt"
Content-Type: text/plain
|html}^"\r"^{html|
--------------------------eb790219f130e103|html}^"\r"^{html|
Content-Disposition: form-data; name="file2"; filename="a.txt"|html}^"\r"^{html|
Content-Type: text/plain|html}^"\r"^{html|
|html}^"\r"^{html|
Content of a.txt.
--------------------------eb790219f130e103--
|html}^"\r"^{html|
--------------------------eb790219f130e103--|html}^"\r"^{html|
|html}

let simple_without_header =
{html|--------------------------eb790219f130e103
Content-Disposition: form-data; name="text"
default
--------------------------eb790219f130e103
Content-Disposition: form-data; name="file1"; filename="a.html"
Content-Type: text/html
{html|--------------------------eb790219f130e103|html}^"\r"^{html|
Content-Disposition: form-data; name="text"|html}^"\r"^{html|
|html}^"\r"^{html|
default|html}^"\r"^{html|
--------------------------eb790219f130e103|html}^"\r"^{html|
Content-Disposition: form-data; name="file1"; filename="a.html"|html}^"\r"^{html|
Content-Type: text/html|html}^"\r"^{html|
|html}^"\r"^{html|
<!DOCTYPE html><title>Content of a.html.</title>
--------------------------eb790219f130e103
Content-Disposition: form-data; name="file2"; filename="a.txt"
Content-Type: text/plain
|html}^"\r"^{html|
--------------------------eb790219f130e103|html}^"\r"^{html|
Content-Disposition: form-data; name="file2"; filename="a.txt"|html}^"\r"^{html|
Content-Type: text/plain|html}^"\r"^{html|
|html}^"\r"^{html|
Content of a.txt.
--------------------------eb790219f130e103--
|html}^"\r"^{html|
--------------------------eb790219f130e103--|html}^"\r"^{html|
|html}

module Map = Map.Make (String)
Expand Down Expand Up @@ -262,22 +262,22 @@ let content_type_2 =
Rresult.R.get_ok value

let contents =
{multipart|
-----------------------------11410681503802810592492044004
Content-Disposition: form-data; name="dream.csrf"
foobar
-----------------------------11410681503802810592492044004
Content-Disposition: form-data; name="files"; filename="a b.txt"
Content-Type: text/plain
1234
-----------------------------11410681503802810592492044004
Content-Disposition: form-data; name="files"; filename="a b.txt"
Content-Type: text/plain
4321
-----------------------------11410681503802810592492044004--
"\r"^{multipart|
-----------------------------11410681503802810592492044004|multipart}^"\r"^{multipart|
Content-Disposition: form-data; name="dream.csrf"|multipart}^"\r"^{multipart|
|multipart}^"\r"^{multipart|
foobar|multipart}^"\r"^{multipart|
-----------------------------11410681503802810592492044004|multipart}^"\r"^{multipart|
Content-Disposition: form-data; name="files"; filename="a b.txt"|multipart}^"\r"^{multipart|
Content-Type: text/plain|multipart}^"\r"^{multipart|
|multipart}^"\r"^{multipart|
1234|multipart}^"\r"^{multipart|
-----------------------------11410681503802810592492044004|multipart}^"\r"^{multipart|
Content-Disposition: form-data; name="files"; filename="a b.txt"|multipart}^"\r"^{multipart|
Content-Type: text/plain|multipart}^"\r"^{multipart|
|multipart}^"\r"^{multipart|
4321|multipart}^"\r"^{multipart|
-----------------------------11410681503802810592492044004--|multipart}^"\r"^{multipart|
|multipart}

let filename_with_space =
Expand Down
28 changes: 14 additions & 14 deletions test/test_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ let () = Logs.set_reporter (reporter Fmt.stderr)
let () = Logs.set_level ~all:true (Some Logs.Debug)

let truncated_request01 =
{|--------------------------eb790219f130e103
Content-Disposition: form-data; name="text"
default
--------------------------eb790219f130e103
Content-Disposition: form-data; name="file1"; filename="a.html"
Content-Type: text/html
<!DOCTYPE html><title>Content of a.html.</title>
--------------------------eb790219f130e103
Content-Disposition: form-data; name="file2"; filename="a.txt"
Content-Type: text/plain
{|--------------------------eb790219f130e103|}^"\r"^{|
Content-Disposition: form-data; name="text"|}^"\r"^{|
|}^"\r"^{|
default|}^"\r"^{|
--------------------------eb790219f130e103|}^"\r"^{|
Content-Disposition: form-data; name="file1"; filename="a.html"|}^"\r"^{|
Content-Type: text/html|}^"\r"^{|
|}^"\r"^{|
<!DOCTYPE html><title>Content of a.html.</title>|}^"\r"^{|
|}^"\r"^{|
--------------------------eb790219f130e103|}^"\r"^{|
Content-Disposition: form-data; name="file2"; filename="a.txt"|}^"\r"^{|
Content-Type: text/plain|}^"\r"^{|
|}^"\r"^{|
Conten|}

let truncated_request02 =
Expand Down