summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-13 16:50:43 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-13 16:50:43 +0100
commit6efa6c7891e15953aabc444cabcd4dc722f076bb (patch)
treeecff6b47f3d6ded6e1f39d9a20bb1bda9c02ba1e
parent1cd687b681224a6a190fea5d542b92f147f9abf0 (diff)
Move basic markup tests to integration 🚚
-rw-r--r--src/parse/tests.rs31
-rw-r--r--tests/ref/basic-markup.pngbin0 -> 5623 bytes
-rw-r--r--tests/typ/basic-markup.typ22
-rw-r--r--tests/typ/func-page.typ1
4 files changed, 23 insertions, 31 deletions
diff --git a/src/parse/tests.rs b/src/parse/tests.rs
index 9a0a4ce6..a8e9dc25 100644
--- a/src/parse/tests.rs
+++ b/src/parse/tests.rs
@@ -10,7 +10,7 @@ use crate::syntax::*;
use BinOp::*;
use Expr::{Angle, Bool, Color, Float, Int, Length, Percent};
-use Node::{Emph, Linebreak, Parbreak, Space, Strong};
+use Node::{Space, Strong};
use UnOp::{Neg, Pos};
macro_rules! t {
@@ -214,35 +214,6 @@ macro_rules! Let {
}
#[test]
-fn test_parse_simple_nodes() {
- // Basics.
- t!("");
- t!(" " Space);
- t!("hi" Text("hi"));
- t!("🧽" Text("🧽"));
- t!("_" Emph);
- t!("*" Strong);
- t!("~" Text("\u{00A0}"));
- t!(r"\" Linebreak);
- t!("\n\n" Parbreak);
-
- // Multiple nodes.
- t!("ab c" Text("ab"), Space, Text("c"));
- t!("a`hi`\r\n\r*" Text("a"), Raw(None, &["hi"], true), Parbreak, Strong);
-
- // Spans.
- t!("*🌍*"
- nodes: [S(0..1, Strong), S(1..5, Text("🌍")), S(5..6, Strong)],
- spans: true);
-
- // Errors.
- t!("]}"
- nodes: [],
- errors: [S(0..1, "unexpected closing bracket"),
- S(1..2, "unexpected closing brace")]);
-}
-
-#[test]
fn test_parse_raw() {
// Basic, mostly tested in tokenizer and resolver.
t!("`py`" nodes: [S(0..4, Raw(None, &["py"], true))], spans: true);
diff --git a/tests/ref/basic-markup.png b/tests/ref/basic-markup.png
new file mode 100644
index 00000000..d65b7fe5
--- /dev/null
+++ b/tests/ref/basic-markup.png
Binary files differ
diff --git a/tests/typ/basic-markup.typ b/tests/typ/basic-markup.typ
new file mode 100644
index 00000000..b7630e7f
--- /dev/null
+++ b/tests/typ/basic-markup.typ
@@ -0,0 +1,22 @@
+// Test text, emph and strong.
+
+Hello 🌏!
+
+_Emph_ and *strong*!
+
+---
+// Test non-breaking space.
+
+The non-breaking~space does not work.
+
+---
+// Test backslash.
+
+// Directly after word.
+Line\ Break
+
+// Spaces around.
+Line \ Break
+
+// Directly before word does not work.
+No \Break
diff --git a/tests/typ/func-page.typ b/tests/typ/func-page.typ
index 7f87a414..6b9382b9 100644
--- a/tests/typ/func-page.typ
+++ b/tests/typ/func-page.typ
@@ -37,7 +37,6 @@ Fourth
Sixth
[page][Seventh and last]
-
---
// Test changing the layouting directions of pages.