-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Due to ppx_expect requiring installing all Jane Street packages as dependencies for pure-html and dream-html. Add a warning about this in the `test/` directory readme.
- Loading branch information
Showing
13 changed files
with
699 additions
and
713 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Snapshot tests | ||
|
||
> [!WARN] | ||
> The tests are using purely dune's file diffing and promotion feature as that | ||
> does not require any library dependencies. We tried using ppx_expect tests but | ||
> the problem is they are _inline_ tests that must be defined in a `library` | ||
> component, not a `test` component like the tests we have now. And `library` | ||
> components need opam packages to be installed _without_ the `with-test` | ||
> annotation, meaning that using ppx_expect would pull in _all_ the Jane Street | ||
> libraries as dependencies of both pure-html and dream-html. So, we are back now | ||
> to dune's diffing and promotion for tests, which require _no_ dependencies. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
|
||
🔎 OK with age | ||
{name: Bob; | ||
age: 42; | ||
accept_tos: true; | ||
permissions: [r]} | ||
|
||
🔎 OK without age | ||
{name: Bob; | ||
age: ; | ||
accept_tos: true; | ||
permissions: [r]} | ||
|
||
🔎 Error without name | ||
[name, error.required] | ||
|
||
🔎 Error with too low age and empty name | ||
[age, error.range; name, Must not be empty] | ||
|
||
🔎 Error too many permissions | ||
[permissions, error.length] | ||
|
||
🔎 Error can't have permissions if not accept TOS | ||
[permissions, error.length] | ||
|
||
🔎 Indent CSRF tag correctly | ||
200 OK | ||
|
||
<form method="post" action="/"> | ||
<input value="token-value" name="dream.csrf" type="hidden"> | ||
<input name="id"> | ||
<button type="submit">Add</button> | ||
</form> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,42 @@ | ||
(test | ||
(name pure_html_test) | ||
(package pure-html) | ||
(libraries pure-html) | ||
(modules pure_html_test) | ||
(action | ||
(diff pure_html_test.expected.txt pure_html_test.got.txt))) | ||
|
||
(rule | ||
(with-stdout-to | ||
pure_html_test.got.txt | ||
(run ./pure_html_test.exe))) | ||
|
||
(test | ||
(name dream_html_test) | ||
(package dream-html) | ||
(libraries dream-html) | ||
(modules dream_html_test) | ||
(preprocess | ||
(pps dream-html.ppx)) | ||
(action | ||
(diff dream_html_test.expected.txt dream_html_test.got.txt))) | ||
|
||
(rule | ||
(with-stdout-to | ||
dream_html_test.got.txt | ||
(run ./dream_html_test.exe))) | ||
|
||
(test | ||
(name route_test) | ||
(package dream-html) | ||
(libraries dream_html) | ||
(modules route_test) | ||
(preprocess | ||
(pps dream-html.ppx)) | ||
(action | ||
(diff expected_route.txt got_route.txt))) | ||
(diff route_test.expected.txt route_test.got.txt))) | ||
|
||
(rule | ||
(with-stdout-to | ||
got_route.txt | ||
route_test.got.txt | ||
(run ./route_test.exe))) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.