aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mdx_esm.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 09:54:56 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 09:55:16 +0200
commita4b56e7b971fa81c56a59b465f90c8016f01320d (patch)
tree7002a44087e57c8158a51dd30b6eb89eb260af2b /tests/mdx_esm.rs
parent1fd94f512834aa7bd70f22a60229ce01edfc754e (diff)
downloadmarkdown-rs-a4b56e7b971fa81c56a59b465f90c8016f01320d.tar.gz
markdown-rs-a4b56e7b971fa81c56a59b465f90c8016f01320d.tar.bz2
markdown-rs-a4b56e7b971fa81c56a59b465f90c8016f01320d.zip
Add support for proper positional info in swc tree
* Fix some positional info in SWC error messages * Add positional info in `to_document` on duplicate layouts * Add support for `path` on `Program` (`to_swc`, `to_document`, `jsx_rewrite`), for the path of a file on disk * Add support for `development` to `jsx-rewrite`, which when defined will embed info on where tags were written into the runtime code when they are not passed * Refactor to move some utilities to `micromark_swc_utils.rs`, `swc_utils.rs`
Diffstat (limited to 'tests/mdx_esm.rs')
-rw-r--r--tests/mdx_esm.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/mdx_esm.rs b/tests/mdx_esm.rs
index d6021a1..31f493b 100644
--- a/tests/mdx_esm.rs
+++ b/tests/mdx_esm.rs
@@ -101,7 +101,7 @@ fn mdx_esm() -> Result<(), String> {
assert_eq!(
micromark_with_options("import 1/1", &swc).err().unwrap(),
- "1:9: Could not parse esm with swc: Expected 'from', got 'numeric literal (1, 1)'",
+ "1:8: Could not parse esm with swc: Expected 'from', got 'numeric literal (1, 1)'",
"should crash on invalid import/exports (2)"
);
@@ -250,7 +250,8 @@ fn mdx_esm() -> Result<(), String> {
Node::Root(Root {
children: vec![Node::MdxjsEsm(MdxjsEsm {
value: "import a from 'b'\nexport {a}".to_string(),
- position: Some(Position::new(1, 1, 0, 2, 11, 28))
+ position: Some(Position::new(1, 1, 0, 2, 11, 28)),
+ stops: vec![(0, 0), (17, 17), (18, 18)]
})],
position: Some(Position::new(1, 1, 0, 2, 11, 28))
}),