diff options
author | Eduardo Julian | 2022-11-15 14:06:17 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-11-15 14:06:17 -0400 |
commit | d656ef2143151a1d78768df4562e5275dff67b9d (patch) | |
tree | 554f6e64c09654e0faeeed3662183c63c35cf514 /stdlib/source/test/lux/world | |
parent | 4c765d22bd0a2e5271bf350745ed29f66bfbb96a (diff) |
Added LineNumberTable annotations to functions when compiling for the JVM.
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r-- | stdlib/source/test/lux/world/net.lux | 21 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/http.lux | 45 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/http/request.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/http/server.lux | 26 |
4 files changed, 63 insertions, 35 deletions
diff --git a/stdlib/source/test/lux/world/net.lux b/stdlib/source/test/lux/world/net.lux index 695308c40..ddcd8dcfd 100644 --- a/stdlib/source/test/lux/world/net.lux +++ b/stdlib/source/test/lux/world/net.lux @@ -12,15 +12,7 @@ ["[0]" / ["[1][0]" mime] ["[1][0]" uri] - ["[1][0]" http - ["[1]/[0]" client] - ["[1]/[0]" cookie] - ["[1]/[0]" header] - ["[1]/[0]" status] - ["[1]/[0]" version] - ["[1]/[0]" response] - ["[1]/[0]" request] - ["[1]/[0]" server]]]) + ["[1][0]" http]]) (def .public test Test @@ -36,15 +28,6 @@ true) /mime.test - - /http/client.test - /http/cookie.test - /http/header.test - /http/status.test - /http/version.test - /http/response.test - /http/request.test - /http/server.test - + /http.test /uri.test ))) diff --git a/stdlib/source/test/lux/world/net/http.lux b/stdlib/source/test/lux/world/net/http.lux new file mode 100644 index 000000000..457eb507e --- /dev/null +++ b/stdlib/source/test/lux/world/net/http.lux @@ -0,0 +1,45 @@ +(.require + [library + [lux (.except) + [abstract + [monad (.only do)]] + [math + ["[0]" random (.only Random)]] + [test + ["_" property (.only Test)]]]] + [\\library + ["[0]" /]] + ["[0]" / + ["[1][0]" client] + ["[1][0]" cookie] + ["[1][0]" header] + ["[1][0]" status] + ["[1][0]" version] + ["[1][0]" response] + ["[1][0]" request] + ["[1][0]" server]]) + +(def .public test + Test + (<| (_.covering /._) + (do [! random.monad] + []) + (all _.and + (_.coverage [/.Method + /.#Post /.#Get /.#Put /.#Patch /.#Delete /.#Head /.#Connect /.#Options /.#Trace] + true) + (_.coverage [/.Body] + true) + (_.coverage [/.Message + /.#headers /.#body] + true) + + /client.test + /cookie.test + /header.test + /status.test + /version.test + /response.test + /request.test + /server.test + ))) diff --git a/stdlib/source/test/lux/world/net/http/request.lux b/stdlib/source/test/lux/world/net/http/request.lux index 0d117920f..afc7e88ad 100644 --- a/stdlib/source/test/lux/world/net/http/request.lux +++ b/stdlib/source/test/lux/world/net/http/request.lux @@ -107,7 +107,7 @@ (let [it (is (/.Request Identity) (<request> (/.utf8 identity.monad expected_text)))] (and (|> it - (the [/.#protocol //.#scheme]) + (the [/.#protocol /.#scheme]) (scheme#= <scheme>)) (|> it (the [/.#message //.#headers]) @@ -135,7 +135,7 @@ (let [it (is (/.Request Identity) (<request> (/.utf8 identity.monad expected_text)))] (and (|> it - (the [/.#resource //.#method]) + (the [/.#resource /.#method]) (|.when {<method>} true @@ -174,7 +174,7 @@ (let [it (is (/.Request Identity) (/.uri expected_uri (/.utf8 identity.monad expected_text)))] (and (|> it - (the [/.#resource //.#uri]) + (the [/.#resource /.#uri]) (same? expected_uri)) (|> it (the [/.#message //.#headers]) diff --git a/stdlib/source/test/lux/world/net/http/server.lux b/stdlib/source/test/lux/world/net/http/server.lux index 63f0d76ed..92f57b953 100644 --- a/stdlib/source/test/lux/world/net/http/server.lux +++ b/stdlib/source/test/lux/world/net/http/server.lux @@ -58,14 +58,14 @@ )) (def identification - (Random //.Identification) + (Random request.Identification) (all random.and ..address ..address )) (def protocol - (Random //.Protocol) + (Random request.Protocol) (all random.and versionT.random schemeT.random @@ -86,7 +86,7 @@ )) (def resource - (Random //.Resource) + (Random request.Resource) (all random.and ..method (random.lower_cased 2) @@ -135,11 +135,11 @@ (`` (all _.and (,, (with_template [<server> <scheme>] [(in (do [! async.monad] - [good_response (let [expected_request (has [request.#protocol //.#scheme] <scheme> expected_request)] + [good_response (let [expected_request (has [request.#protocol request.#scheme] <scheme> expected_request)] (<server> expected_server ! expected_request)) good_body ((the [response.#message //.#body] good_response) {.#None}) - bad_response (let [expected_request (has [request.#protocol //.#scheme] scheme.file expected_request)] + bad_response (let [expected_request (has [request.#protocol request.#scheme] scheme.file expected_request)] (<server> expected_server ! expected_request))] (unit.coverage [<server>] (and (n.= expected_status @@ -174,11 +174,11 @@ (`` (all _.and (,, (with_template [<server> <correct_method> <incorrect_method>] [(in (do [! async.monad] - [good_response (let [expected_request (has [request.#resource //.#method] {<correct_method>} expected_request)] + [good_response (let [expected_request (has [request.#resource request.#method] {<correct_method>} expected_request)] (<server> expected_server ! expected_request)) good_body ((the [response.#message //.#body] good_response) {.#None}) - bad_response (let [expected_request (has [request.#resource //.#method] {<incorrect_method>} expected_request)] + bad_response (let [expected_request (has [request.#resource request.#method] {<incorrect_method>} expected_request)] (<server> expected_server ! expected_request))] (unit.coverage [<server>] (and (n.= expected_status @@ -226,11 +226,11 @@ [bad_uri (random.upper_cased 2) good_uri (random.upper_cased 3)] (in (do [! async.monad] - [good_response (let [expected_request (has [request.#resource //.#uri] good_uri expected_request)] + [good_response (let [expected_request (has [request.#resource request.#uri] good_uri expected_request)] (/.uri good_uri expected_server ! expected_request)) good_body ((the [response.#message //.#body] good_response) {.#None}) - bad_response (let [expected_request (has [request.#resource //.#uri] bad_uri expected_request)] + bad_response (let [expected_request (has [request.#resource request.#uri] bad_uri expected_request)] (/.uri good_uri expected_server ! expected_request))] (unit.coverage [/.uri] (and (n.= expected_status @@ -250,13 +250,13 @@ [.let [server (is /.Server (/.or (/.http expected_server) (/.https expected_server)))] - http_response (server ! (has [request.#protocol //.#scheme] scheme.http expected_request)) + http_response (server ! (has [request.#protocol request.#scheme] scheme.http expected_request)) http_body ((the [response.#message //.#body] http_response) {.#None}) - https_response (server ! (has [request.#protocol //.#scheme] scheme.https expected_request)) + https_response (server ! (has [request.#protocol request.#scheme] scheme.https expected_request)) https_body ((the [response.#message //.#body] https_response) {.#None}) - bad_response (server ! (has [request.#protocol //.#scheme] scheme.file expected_request))] + bad_response (server ! (has [request.#protocol request.#scheme] scheme.file expected_request))] (unit.coverage [/.or] (let [correct_http_status! (n.= expected_status @@ -297,7 +297,7 @@ (in (do [! async.monad] [.let [server (is (/.Server Async) (/.static (response.content ! expected_status expected_mime expected_data)))] - response (server ! (has [request.#protocol //.#scheme] scheme.http expected_request)) + response (server ! (has [request.#protocol request.#scheme] scheme.http expected_request)) body ((the [response.#message //.#body] response) {.#None})] (unit.coverage [/.static] (and (n.= expected_status |