Skip to content

Commit

Permalink
Added a test for string escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
zrho committed Nov 4, 2024
1 parent 3eeb9f7 commit bf401c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hugr-model/tests/fixtures/model-literals.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(hugr 0)

(define-alias mod.string str "\"\n\r\t\\\u{1F44D}")
7 changes: 7 additions & 0 deletions hugr-model/tests/snapshots/text__literals.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
source: hugr-model/tests/text.rs
expression: "roundtrip(include_str!(\"fixtures/model-literals.edn\"))"
---
(hugr 0)

(define-alias mod.string str "\"\n\r\t\\👍")
5 changes: 5 additions & 0 deletions hugr-model/tests/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ fn roundtrip(source: &str) -> String {
pub fn test_declarative_extensions() {
insta::assert_snapshot!(roundtrip(include_str!("fixtures/model-decl-exts.edn")))
}

#[test]
pub fn test_literals() {
insta::assert_snapshot!(roundtrip(include_str!("fixtures/model-literals.edn")))
}

0 comments on commit bf401c1

Please sign in to comment.