mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
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:
parent
05ab018380
commit
0faa1d5f20
8 changed files with 679 additions and 278 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue