File: literate_tabbed.litcoffee

package info (click to toggle)
coffeescript 2.7.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,360 kB
  • sloc: makefile: 20; xml: 9; sh: 6; javascript: 5
file content (137 lines) | stat: -rw-r--r-- 2,309 bytes parent folder | download | duplicates (2)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Tabbed Literate CoffeeScript Test

comment comment

	testsCount = 0 # Track the number of tests run in this file, to make sure they all run

	test "basic literate CoffeeScript parsing", ->
		ok yes
		testsCount++

now with a...

	test "broken up indentation", ->

... broken up ...

		do ->

... nested block.

			ok yes
			testsCount++

Code must be separated from text by a blank line.

	test "code blocks must be preceded by a blank line", ->

The next line is part of the text and will not be executed.
    fail()

		ok yes
		testsCount++

Code in `backticks is not parsed` and...

	test "comments in indented blocks work", ->
		do ->
			do ->
				# Regular comment.

				###
					Block comment.
				###

				ok yes
				testsCount++

Regular [Markdown](http://example.com/markdown) features, like links
and unordered lists, are fine:

  * I

  * Am

  * A

  * List

---

	# keep track of whether code blocks are executed or not
	executed = false

<p>

if true
	executed = true # should not execute, this is just HTML para, not code!

</p>

	test "should ignore code blocks inside HTML", ->
		eq executed, false
		testsCount++

---

*   A list item followed by a code block:

	test "basic literate CoffeeScript parsing", ->
		ok yes
		testsCount++

---

*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    viverra nec, fringilla in, laoreet vitae, risus.

*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    Suspendisse id sem consectetuer libero luctus adipiscing.

---

This is [an example][id] reference-style link.
[id]: http://example.com/  "Optional Title Here"

---

	executed = no

1986. What a great season.

	executed = yes

and test...

	test "should recognize indented code blocks in lists with empty line as separator", ->
		ok executed
		testsCount++

---

	executed = no

1986\. What a great season.
				executed = yes

and test...

	test "should ignore indented code in escaped list like number", ->
		eq executed, no
		testsCount++

one last test!

	test "block quotes should render correctly", ->
		quote = '''
			foo
					and bar!
		'''
		eq quote, 'foo\n\t\tand bar!'
		testsCount++

and finally, how did we do?

	test "all tabbed literate CoffeeScript tests executed", ->
		eq testsCount, 9