| Crates.io | jasca |
| lib.rs | jasca |
| version | 0.2.0 |
| created_at | 2025-11-17 21:47:40.330624+00 |
| updated_at | 2025-11-17 21:47:40.330624+00 |
| description | Implementation of the XMPP Testing framwork “Scansion” in Rust |
| homepage | |
| repository | https://code.bouah.net/pep/jasca |
| max_upload_size | |
| id | 1937588 |
| size | 118,730 |
Implementation of the XMPP Testing framwork “Scansion” in Rust
At the moment, jasca doesn't act as an xmpp client (unlike the original project) and only provides structs for comparing elements.
SPDX: MPL-2.0. See LICENSE file.
Language features are defined here:
https://matthewwild.co.uk/projects/scansion/usage/script-basics/
This library supports parsing the following:
# at the beginning of the file. All metadata lines
are optional. If a single line is found it's set as the title, the second
lines are set as the description. Lines starting with ## right below will
be added as tags. A description is not needed for tags to be added.
\t) character, in the
form attr: value, and ending with a newline (\n). Any line that
matches this format will be parsed and will be discarded if it doesn't
match an actual client attribute.
jid::FullJid (given a resource if necessary).\t) character, in the
form attr: value, and ending with a newline (\n). Any line that
matches this format will be parsed and will be discarded if it doesn't
match an actual client attribute.
\t) after the
action will be converted to a minidom::Element.receives: nothing as the absence of received stanza.${louise's JID})${louise's full JID}){scansion:any}# or // and ending with a newline
(\n). They get discarded in the outputScanElement is a wrapper to minidom::Element that reimplements
PartialEq. Most checks will happen in there, variables in attributes will
also be read at this time.
PartialEq is only implemented for Element as it wouldn't make sense to
compare two ScanElements.
This interface may change in the future as it doesn't allow returning a Result
(errors may happen when parsing variables: missing from context, etc.).
Currently when a referenced client doesn't exist in context, the comparison
fails. If no context has been specified, comparison will go on, skipping
variable handling.
minidom::Element requires every element to be namespaced and ScanElement
has no special treatment for this. Be sure to include namespaces in your
Elements. You may want to use Element::from_reader_with_prefixes.
Namespaced attributes aren't yet handled by minidom so scansion:strict
also isn't treated in any special way.
To help with comparing stanzas transmitted over-the-wire that aren't pretty-printed, as they may be in scansion test files, special whitespace handling is done.
Text nodes containing only whitespace are considered insignificant, and removed from the comparison. Additionally in non-strict mode, unique child text nodes are trimmed (whitespace removed around text).
This is a bit restrictive, as it is for example possible to send messages including leading or ending newlines, the
element in a message is free form after all. But for the purpose of testing with scansion this is not allowed.Everything that's supported by upstream should be supported by this library.