Skip to content

Commit 2ac89a5

Browse files
committed
remove stale tests and fuzz targets
1 parent de003dd commit 2ac89a5

File tree

3 files changed

+0
-99
lines changed

3 files changed

+0
-99
lines changed

crates/quarto_markdown_pandoc/fuzz/Cargo.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ libfuzzer-sys = "0.4"
1313
[dependencies.quarto_markdown_pandoc]
1414
path = ".."
1515

16-
[[bin]]
17-
name = "fuzz_target_1"
18-
path = "fuzz_targets/fuzz_target_1.rs"
19-
test = false
20-
doc = false
21-
bench = false
22-
2316
[[bin]]
2417
name = "hello_fuzz"
2518
path = "fuzz_targets/hello_fuzz.rs"

crates/quarto_markdown_pandoc/fuzz/fuzz_targets/fuzz_target_1.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

crates/tree-sitter-qmd/bindings/rust/parser.rs

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -423,88 +423,3 @@ impl MarkdownParser {
423423
self.parse_with(&mut |byte, _| &text[byte..], old_tree)
424424
}
425425
}
426-
427-
#[cfg(test)]
428-
mod tests {
429-
use tree_sitter::{InputEdit, Point};
430-
431-
use super::*;
432-
433-
#[test]
434-
fn inline_ranges() {
435-
let code = "# title\n\nInline [content].\n";
436-
let mut parser = MarkdownParser::default();
437-
let mut tree = parser.parse(code.as_bytes(), None).unwrap();
438-
439-
let section = tree.block_tree().root_node().child(0).unwrap();
440-
assert_eq!(section.kind(), "section");
441-
let heading = section.child(0).unwrap();
442-
assert_eq!(heading.kind(), "atx_heading");
443-
let paragraph = section.child(1).unwrap();
444-
assert_eq!(paragraph.kind(), "paragraph");
445-
let inline = paragraph.child(0).unwrap();
446-
assert_eq!(inline.kind(), "inline");
447-
assert_eq!(
448-
tree.inline_tree(&inline)
449-
.unwrap()
450-
.root_node()
451-
.child(0)
452-
.unwrap()
453-
.kind(),
454-
"shortcut_link"
455-
);
456-
457-
let code = "# Title\n\nInline [content].\n";
458-
tree.edit(&InputEdit {
459-
start_byte: 2,
460-
old_end_byte: 3,
461-
new_end_byte: 3,
462-
start_position: Point { row: 0, column: 2 },
463-
old_end_position: Point { row: 0, column: 3 },
464-
new_end_position: Point { row: 0, column: 3 },
465-
});
466-
let tree = parser.parse(code.as_bytes(), Some(&tree)).unwrap();
467-
468-
let section = tree.block_tree().root_node().child(0).unwrap();
469-
assert_eq!(section.kind(), "section");
470-
let heading = section.child(0).unwrap();
471-
assert_eq!(heading.kind(), "atx_heading");
472-
let paragraph = section.child(1).unwrap();
473-
assert_eq!(paragraph.kind(), "paragraph");
474-
let inline = paragraph.child(0).unwrap();
475-
assert_eq!(inline.kind(), "inline");
476-
assert_eq!(
477-
tree.inline_tree(&inline)
478-
.unwrap()
479-
.root_node()
480-
.named_child(0)
481-
.unwrap()
482-
.kind(),
483-
"shortcut_link"
484-
);
485-
}
486-
487-
#[test]
488-
fn markdown_cursor() {
489-
let code = "# title\n\nInline [content].\n";
490-
let mut parser = MarkdownParser::default();
491-
let tree = parser.parse(code.as_bytes(), None).unwrap();
492-
let mut cursor = tree.walk();
493-
assert_eq!(cursor.node().kind(), "document");
494-
assert!(cursor.goto_first_child());
495-
assert_eq!(cursor.node().kind(), "section");
496-
assert!(cursor.goto_first_child());
497-
assert_eq!(cursor.node().kind(), "atx_heading");
498-
assert!(cursor.goto_next_sibling());
499-
assert_eq!(cursor.node().kind(), "paragraph");
500-
assert!(cursor.goto_first_child());
501-
assert_eq!(cursor.node().kind(), "inline");
502-
assert!(cursor.goto_first_child());
503-
assert_eq!(cursor.node().kind(), "shortcut_link");
504-
assert!(cursor.goto_parent());
505-
assert!(cursor.goto_parent());
506-
assert!(cursor.goto_parent());
507-
assert!(cursor.goto_parent());
508-
assert_eq!(cursor.node().kind(), "document");
509-
}
510-
}

0 commit comments

Comments
 (0)