test_gen: replace stdlib Json with inline implementation

Towards the goal of removing Json from stdlib, this change replaces
usage of TotallyNotJson in test_gen/gen_abilities with a simple usable
inline implementation of Encoder/DecoderFormatting.

Similarly, the use of TotallyNotJson in test_reporting is not necessary
at all and is replaced with a Decoder that wouldn't actually work, but
which does compile.
This commit is contained in:
shua 2024-06-28 15:20:29 +02:00
parent 05ab018380
commit 0faa1d5f20
No known key found for this signature in database
GPG key ID: 73387DA37055770F
8 changed files with 679 additions and 278 deletions

View file

@ -18,3 +18,11 @@ macro_rules! assert_multiline_str_eq {
$crate::_pretty_assert_eq!($crate::DebugAsDisplay($a), $crate::DebugAsDisplay($b))
};
}
/// a very simple implementation of En/DecoderFormatting to be embedded in roc source under test
///
/// - numbers and bools are encoded as 'n' <num> ' '
/// - strings are encoded as 's' <count utf-8 bytes> ' ' <str> ' '
/// - records are encoded as 'r' <number of fields> ' ' [<key><value>]*
/// - lists and tuples are encoded as 'l' <len> ' ' [<elem>]*
pub const TAG_LEN_ENCODER_FMT: &str = include_str!("TagLenEncoderFmt.roc");