about summary refs log tree commit diff stats
path: root/tests/run.scm
blob: 1ec4ffebb4ac6676962b0b6bfd19771c419d9f92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
(import scheme
        (chicken base)
        (chicken load)
        (chicken port)
        (chicken process-context)
        test)

;;; Setup

(import (jimmy emit)
        (jimmy read)
        #;(jimmy wrap))

(define test-doc #<<end-document
: title a test document
: date 2024-05-13T03:02:45Z
: uuid b3daebf1-440b-4828-a4d9-9089c7bd7c61

# a test document of some kind

here is a test document.
it has paragraphs
=> example.com with links!
and other things.

## a code example
```
for (a=1;a<=4;a++) {
	printf("%d\n", a);
}
```

### other examples

> a blockquote is a quote
> that is blocky.

* list 1
* list 2
* list 3
=> example.com link list 1
=> example.com link list 2
=> example.com link list 3

ok, now for another test:
will *strong* in-line text be converted?
as well as `code`, _emph_ and such?
what if *i _nest_ them*
what if *i _nest them* wrong_ ?
what about *breaking them
over two lines?*
end-document
)

;;; Tests

(test "read"
      '((meta ("title" "a" "test" "document")
              ("date" "2024-05-13T03:02:45Z")
              ("uuid" "b3daebf1-440b-4828-a4d9-9089c7bd7c61"))
        (hdr1 ("a" "test" "document" "of" "some" "kind"))
        (para "here is a test document." "it has paragraphs" (link "example.com"
                                                                   "with"
                                                                   "links!")
              "and other things.")
        (hdr2 ("a" "code" "example"))
        (verb "for (a=1;a<=4;a++) {" "\tprintf(\"%d\\n\", a);" "}")
        (hdr3 ("other" "examples"))
        (quot ("a" "blockquote" "is" "a" "quote") ("that" "is" "blocky."))
        (list ("list" "1") ("list" "2") ("list" "3"))
        (link ("example.com" "link" "list" "1") ("example.com" "link" "list"
                                                 "2") ("example.com" "link"
                                                       "list" "3"))
        (para "ok, now for another test:" "will *strong* in-line text be
converted?" "as well as `code`, _emph_ and such?" "what if *i _nest_ them*"
"what if *i _nest them* wrong_ ?" "what about *breaking them" "over two
lines?*"))
      (call-with-input-string test-doc parse))

(test-exit)