naomijub / edn-rs

[DEPRECATED]: Crate to parse and emit EDN
https://crates.io/crates/edn-rs
MIT License
81 stars 14 forks source link

Parsing Edn::from_str removes spaces inside string #32

Closed evaporei closed 4 years ago

evaporei commented 4 years ago

This example fails for example:

let edn = "\"hello    brave new world\"";

assert_eq!(
    Edn::from_str(edn).unwrap(),
    Edn::Str(
        "hello    brave new world".to_string()
    )
)

I've added a branch with this test: https://github.com/naomijub/edn-rs/tree/replace-too-many-spaces

evaporei commented 4 years ago

For error visualization:


failures:

---- deserialize::test::parse_spacy_str stdout ----
thread 'deserialize::test::parse_spacy_str' panicked at 'assertion failed: `(left == right)`
  left: `Str("hello brave new world")`,
 right: `Str("hello    brave new world")`', src/deserialize/mod.rs:315:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    deserialize::test::parse_spacy_str

test result: FAILED. 24 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--lib'

or image: Screenshot from 2020-08-20 09-42-27

or link hahah:

https://github.com/naomijub/edn-rs/runs/1007657421

naomijub commented 4 years ago

https://github.com/naomijub/edn-rs/pull/40