Conversation
3.1.1 and 3.1.2 fix the bounds of ocsipersist-lib on lwt (>= 5.7.0) and OCaml (>= 4.14).
Alcotest suite in test/unit, run by dune runtest, covering the encoding of typed parameters into HTTP parameters and URL suffixes, decoding back (round trips, typing and wrong-parameter errors, optional values, sets, lists, sums, suffixes and their version without suffix), the names used in forms and non-localized parameters. The tests use Parameter_base, whose types are concrete, since decoding through Parameter needs a request. The test executable needs an ocsipersist backend: ocsipersist-sqlite is added as a test dependency.
Cover what does not depend on a site or a request: relative paths, make_actual_path, assembly of URL components, protocol prefixes, and URLs of external services with parameters, suffixes, fragments, preapplied parameters and non-localized parameters.
Install the test dependencies, pinning ocsipersist-sqlite 3.1.0 like ocsipersist, and run dune runtest. The ppx cram tests are attached to the eliom package so that they run with -p.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step of a test suite for Eliom, which only had two cram tests of the server ppx.
Content
test/unit: an Alcotest suite for pure functions (no site, no request, no server), run bydune runtest.test_parameter: encoding of typed parameters into HTTP parameters and URL suffixes; decoding back (round trips, typing and wrong-parameter errors, optional values, sets, lists, sums, suffixes and their version without suffix); names used in forms; non-localized parameters. Decoding goes throughParameter_base.reconstruct_params_, sinceParameter.reconstruct_paramsneeds a request.test_uri: relative paths,make_actual_path, assembly of URL components, protocol prefixes, and URLs of external services (parameters, suffixes, fragments, preapplied and non-localized parameters).alcotest, andocsipersist-sqlitebecause a program linkingeliom.serverneeds an ocsipersist backend.ocsipersist-lib) andocsipersist-sqlite3.1.2, installs with--with-test, runsdune runtest -p eliom,eliom-compat. The ppx cram tests are attached to theeliompackage so that they run with-p.Each test was checked to fail when the code it covers is broken, by temporarily mutating
parameter_base.shared.mlandeliom_uri.shared.ml.Next steps (separate PRs)