mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
fix a test for 4.04
This commit is contained in:
parent
4ad8d91f7c
commit
a4438dbdf6
3 changed files with 16 additions and 4 deletions
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
|
|
@ -36,5 +36,10 @@ jobs:
|
|||
|
||||
- run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip
|
||||
|
||||
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest
|
||||
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
|
||||
- run: opam install tiny_httpd
|
||||
|
||||
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd_camlzip
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
(targets vfs.ml)
|
||||
(deps (source_tree files) (:out test_output.txt.expected))
|
||||
(enabled_if (= %{system} "linux"))
|
||||
(action (run ../src/bin/vfs_pack.exe -o %{targets}
|
||||
(action (run %{bin:tiny-httpd-vfs-pack} -o %{targets}
|
||||
--mirror=files/
|
||||
--file=test_out.txt,%{out}
|
||||
--url=example_dot_com,http://example.com)))
|
||||
|
|
@ -44,6 +44,7 @@
|
|||
(rule
|
||||
(targets vfs.ml)
|
||||
(enabled_if (<> %{system} "linux"))
|
||||
(package tiny_httpd)
|
||||
(action
|
||||
(with-stdout-to
|
||||
%{targets}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
open Tiny_httpd_html
|
||||
let spf = Printf.sprintf
|
||||
|
||||
let list_init n f =
|
||||
let rec loop i =
|
||||
if i=n then []
|
||||
else f i :: loop (i+1)
|
||||
in loop 0
|
||||
|
||||
let t1() =
|
||||
html [] [
|
||||
head [] [];
|
||||
body [] [
|
||||
ul [A.style "list-style: circle"] (
|
||||
li[][pre [] [txt "a"; pre[][txt "c"; txt"d"]; txt "b"]] ::
|
||||
List.init 100 (fun i -> li [A.id (spf "l%d" i)] [txt (spf "item %d" i)])
|
||||
list_init 100 (fun i -> li [A.id (spf "l%d" i)] [txt (spf "item %d" i)])
|
||||
)
|
||||
]
|
||||
]
|
||||
|
|
@ -19,7 +25,7 @@ let t2() =
|
|||
pre [] [txt "a"; txt "b"];
|
||||
body [] [
|
||||
ul' [A.style "list-style: circle"] [
|
||||
sub_l @@ List.init 100 @@ fun i ->
|
||||
sub_l @@ list_init 100 @@ fun i ->
|
||||
li ~if_:(i<> 42) [A.id (spf "l%d" i)] [txt (spf "item %d" i)]
|
||||
]
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue