summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/test2.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdoc: derives: New `skip` document field optionIan Jackson2026-01-141-0/+3
| | | | | This lets us having document items that are "manually non exhaustive" which is necessary for struct literal constructors.
* tor-netdoc: test2: Make t_ok (which takes no boundaries) take &D not &[D]Ian Jackson2025-12-181-16/+16
|
* tor-netdoc: test2: Test parse_netdoc_multiple_with_offsetsIan Jackson2025-12-181-2/+25
| | | | | | * Make a fancy version of t_ok, t_ok_multi, that takes the expected boundary byte offsets. * t_ok is now just for single-document files and is implemented in terms of t_ok_multi. * Use t_ok_multi for the one test case with multiple documents.
* tor-netdoc: test2: Add a test file with more than one documentIan Jackson2025-12-181-0/+17
|
* tor-netdoc: rustfmtIan Jackson2025-12-181-2/+1
|
* tor-netdoc: Use $P for prelude in one placeIan Jackson2025-12-181-1/+1
| | | | This was missed, apparently.
* tor-netdoc: test2: check round-trip encodingIan Jackson2025-12-101-29/+162
| | | | | | | | | | | | | The test case documents are often not in canonical form. We don't want to change them to be in canonical form because we want to test parsing edge cases. So, we provide a mangling scheme with in-document notes, and annotate all the documents. Apply suitable annotations to all the documents. Test that the encoded forms are as expected. This reverts commit 05e7b8b60061a7e8a8d004a822cc213d3ea22d47.
* tor-netdoc: test2: implement encoding traits for all test typesIan Jackson2025-12-101-19/+58
| | | | | | | Make this whole module conditional on the encode feature. Apply the derives. Provide the necessary manual implementations for the types where we use `with`.
* tor-netdoc: test2: Don't ever have raw String in defaulted argumentsIan Jackson2025-12-041-9/+9
| | | | | | | These cannot be encoded. So that is logically incoherent. (Perhaps String ought not to be NormalItemArgument, but let's not tackle that now.)
* parse2: ItemValueParseable, netdoc(rest, with): reworkIan Jackson2025-12-021-2/+2
| | | | | | | | | | The path in `with` must always be a module, not a function, because we need to use it for encoding too. In the case of `rest`, it's probably sensible to require a different function name, given that the semantics are subtly different to those of `rest` without `with`, since the latter can only get a single word but with `rest` you get the whole line.
* tor-netdoc: test2: Run rustfmtIan Jackson2025-11-241-10/+2
| | | | Tidy up the imports.
* tor-netdoc: test2: Adjust type aliasesIan Jackson2025-11-241-14/+12
| | | | | | Now that this module is not inside parse2 its identifier namespace oughtn't to be parse-specific. Rename things so that every imports/aliases related to parsing implies parsing in its name.
* tor-netdoc: Move parse2/test.rs to test2.rsIan Jackson2025-11-241-0/+763
We're going to use this for the encoder testing too, so it needs to be not buried inside parse2. This commit is the file rename plus minimal changes to make it compile.