forked from aichaos/rivescript-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_options.py
More file actions
76 lines (63 loc) · 2.16 KB
/
Copy pathtest_options.py
File metadata and controls
76 lines (63 loc) · 2.16 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from .config import RiveScriptTestCase
class ParserOptionTest(RiveScriptTestCase):
"""File scoped parser option tests."""
def test_concat(self):
self.new("""
// Default concat mode = none
+ test concat default
- Hello
^ world!
! local concat = space
+ test concat space
- Hello
^ world!
! local concat = none
+ test concat none
- Hello
^ world!
! local concat = newline
+ test concat newline
- Hello
^ world!
// invalid concat setting is equivalent to `none`
! local concat = foobar
+ test concat foobar
- Hello
^ world!
! local concat = none
+ test concat
^ in trigger
- Hello
^ world!
! local concat = none
+ [test] concat
^ \sin trigger with space and optional
- Hello
^ \sworld!
! local concat = space
+ test concat space
^ in trigger
- Hello
^ world!
// the option is file scoped so it can be left at
// any setting and won't affect subsequent parses
! local concat = newline
""")
self.extend("""
// concat mode should be restored to the default in a
// separate file/stream parse
+ test concat second file
- Hello
^ world!
""")
self.reply("test concat default", "Helloworld!")
self.reply("test concat space", "Hello world!")
self.reply("test concat none", "Helloworld!")
self.reply("test concat newline", "Hello\nworld!")
self.reply("test concat second file", "Helloworld!")
self.reply("test concatin trigger", "Helloworld!")
self.reply("test concat in trigger with space and optional", "Hello world!")
self.reply("test concat space in trigger", "Hello world!")