Skip to content

Commit bdb49c9

Browse files
committed
more tests
1 parent 91fe20e commit bdb49c9

File tree

7 files changed

+58
-190
lines changed

7 files changed

+58
-190
lines changed

Cargo.lock

Lines changed: 0 additions & 159 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
chrono = { version = "0.4.38", features = ["serde"] }
87
chumsky = "0.9.3"
98
itertools = "0.13.0"
10-
ordered-float = { version = "4.5.0", features = ["serde"] }
119
serde = { version = "1.0.203", features = ["derive"] }
1210
unicode_categories = "0.1.1"
1311

src/metadata/mod.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ mod tests {
6464
#[test]
6565
fn arrays() {
6666
let examples: Vec<_> = [
67-
"empty_arr: []",
67+
"empty_arr: []
68+
arr: [
69+
70+
]",
6871
"
6972
categories: [
7073
one
@@ -73,7 +76,7 @@ mod tests {
7376
]",
7477
"
7578
arr: [
76-
arrays can contain a ton of shit
79+
arrays can contain everything
7780
5
7881
-5
7982
6.02e27
@@ -101,19 +104,26 @@ mod tests {
101104
}
102105

103106
#[test]
104-
fn keys() {
107+
fn keys_and_values() {
105108
let examples: Vec<_> = [
106109
"key: value",
107110
"x:y",
111+
"x :y",
108112
"x:5",
109113
"x:-4",
110-
"x:-4b",
114+
"str:-4b",
115+
"nil:nil",
116+
"nil:",
117+
"still_nil:
118+
x: y",
111119
"
112-
arr: [
113-
is this okay?
114-
]
115-
huh: string
120+
key: value with : in it
121+
key_2: value with: in it
116122
",
123+
"keys: {
124+
in:
125+
objects: []
126+
}"
117127
]
118128
.into_iter()
119129
.map(|example| example.to_string() + "\n")

src/metadata/snapshots/rust_norg__metadata__tests__arrays.snap

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ source: src/metadata/mod.rs
33
expression: examples
44
---
55
- Object:
6+
arr:
7+
Array: []
68
empty_arr:
79
Array: []
810
- Object:
@@ -14,7 +16,7 @@ expression: examples
1416
- Object:
1517
arr:
1618
Array:
17-
- Str: arrays can contain a ton of shit
19+
- Str: arrays can contain everything
1820
- Num: 5
1921
- Num: -5
2022
- Num: 6020000000000000000000000000
@@ -25,3 +27,7 @@ expression: examples
2527
- Str: b
2628
x:
2729
Str: y
30+
- Array: []
31+
- Array:
32+
- Str: hi
33+
- Str: hi

src/metadata/snapshots/rust_norg__metadata__tests__keys.snap

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,24 @@ expression: examples
1515
x:
1616
Num: -4
1717
- Object:
18-
x:
18+
str:
1919
Str: "-4b"
2020
- Object:
21-
arr:
22-
Array:
23-
- Str: is this okay?
24-
huh:
25-
Str: string
21+
nil: Nil
22+
- Object:
23+
nil: Nil
24+
- Object:
25+
still_nil: Nil
26+
x:
27+
Str: y
28+
- Object:
29+
key:
30+
Str: "value with : in it"
31+
key_2:
32+
Str: "value with: in it"
33+
- Object:
34+
keys:
35+
Object:
36+
in: Nil
37+
objects:
38+
Array: []

0 commit comments

Comments
 (0)