forked from Enthalpy-AC/catalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testAll.py
2535 lines (1897 loc) · 59.7 KB
/
testAll.py
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# coding: UTF-8
import os
import unittest
import json
import subprocess
from catalysis_globals import err_dict
class TestCase(unittest.TestCase):
maxDiff = None
filename = ""
folder = ""
def catalyze(self, macro, obj, frame):
return subprocess.check_output(["python", "catalysis.py", macro, obj, frame]).splitlines()[-1]
def returnFile(self, filename="test_lib/testData.txt"):
with open(filename) as g:
header, data = g.read().splitlines()
assert header == r"//Definition//Def6"
return json.loads(data)
def checkError(self, msg, macro="", obj="", frame =""):
'''Run the program, and assert that it raised the expected error.
Error is encoded as (line number or "end of file", error key from
catalysis_globals, any necessary arguments)'''
location = "line {}".format(msg[0]) if isinstance(msg[0], int) else msg[0]
msg = err_dict[msg[1]].format(*msg[2:])
self.assertEqual(self.catalyze(macro, obj, frame), "Error on {} of {}: {}".format(location, self.filename, msg))
def checkFile(self, filename, macro="", obj="", frame=""):
'''Run the program, assert that it worked, and compare the result file
with the file with name filename in the target folder.'''
self.assertEqual(self.catalyze(macro, obj, frame), "Catalysis complete!")
self.assertDictEqual(self.returnFile("test_lib/{}/{}.txt".format(self.folder, filename)), self.returnFile())
class ObjectErrors(TestCase):
filename = "/object_data.txt"
class MacroErrors(TestCase):
filename = "/macro_data.txt"
class FrameErrors(TestCase):
filename = "/frame_data.txt"
class ObjectCoreGrammar(ObjectErrors):
folder = "object"
def test_blank(self):
self.checkFile("blank")
def test_take_objects(self):
self.checkError((1, "expected_new_obj"), obj="fail")
def test_invalid_object(self):
self.checkError((1, "unk line"), obj="plac {")
def test_unclosed_object(self):
self.checkError(("end of file", "unclosed", "Object"), obj="place {")
class ObjectPopups(ObjectErrors):
folder = "object"
def test_blank(self):
self.checkFile("popup", obj="""Popup {
}""")
def test_popup_specific(self):
self.checkFile("popup name", obj="""Popup My Popup {
}""")
def test_name(self):
self.checkFile("popup name", obj="""Popup {
name: My Popup
}""")
def test_place(self):
self.checkFile("popup path", obj="""Popup {
path: dummy place
}""")
def test_internal(self):
self.checkFile("popup internal path", obj="""Popup {
path:: objection
}""")
def test_base(self):
self.checkFile("popup base", obj="""Popup {
base: objection
}""")
class ObjectSound(ObjectErrors):
folder = "object"
def test_blank(self):
self.checkFile("sound", obj="""Sound {
}""")
def test_name(self):
self.checkFile("sound name", obj="""Sound {
name: My Sound
}""")
def test_path(self):
self.checkFile("sound path", obj="""Sound {
path: fake_sound
}""")
def test_path_internal(self):
self.checkFile("sound internal path", obj="""Sound {
path:: phoenix objection
}""")
def test_volume(self):
self.checkFile("sound volume", obj="""Sound {
volume: 1
}""")
def test_volume_int(self):
self.checkError((2, "int", "Volume"), obj="""Sound {
volume: 1.2""")
def test_volume_pos(self):
self.checkError((2, "min", "Volume", 1), obj="""Sound {
volume: 0
}""")
class ObjectMusic(ObjectErrors):
folder = "object"
def test_blank(self):
self.checkFile("music", obj="""Music {
}""")
def test_name(self):
self.checkFile("music name", obj="""Music {
name: My Music
}""")
def test_path(self):
self.checkFile("music path", obj="""Music {
path: fake song
}""")
def test_path_internal(self):
self.checkFile("music internal path", obj="""Music {
path:: pw1
}""")
def test_volume(self):
self.checkFile("music volume", obj="""Music {
volume: 1
}""")
def test_volume_int(self):
self.checkError((2, "int", "Volume"), obj="""Music {
volume: 1.2""")
def test_volume_pos(self):
self.checkError((2, "min", "Volume", 1), obj="""Music {
volume: 0""")
def test_loop(self):
self.checkFile("music volume", obj="""Music {
volume: 1
}""")
def test_loop_int(self):
self.checkError((2, "int", "Loop start time"), obj="""Music {
loop: 1.2""")
def test_loop_pos(self):
self.checkError((2, "min", "Loop start time", 0), obj="""Music {
loop: -1""")
class ObjectPlace(ObjectErrors):
folder = "object"
def test_blank(self):
self.checkFile("place", obj="""Place {
}""")
def test_name(self):
self.checkFile("place name", obj="""Place {
name: My Place
}""")
def test_path(self):
self.checkFile("place path", obj="""Place {
path: My Place
}""")
def test_path_internal(self):
self.checkFile("place internal path", obj="""Place {
path:: aj lobby
}""")
def test_path_default(self):
self.checkFile("place default path", obj="""Place {
path:: aj judge
}""")
class ObjectEvidence(ObjectErrors):
folder = "object"
def test_blank(self):
self.checkFile("evidence", obj="""Evidence {
}""")
def test_name(self):
self.checkFile("evidence name", obj="""Evidence {
name: My Evidence
}""")
def test_descript(self):
self.checkFile("evidence descript", obj="""Evidence {
description: My Description
}""")
def test_descript_plus(self):
self.checkFile("evidence descript plus", obj="""Evidence {
description: My Description
: Is on two lines.
}""")
def test_meta(self):
self.checkFile("evidence meta", obj="""Evidence {
metadata: My Metadata
}""")
def test_meta_blank(self):
self.checkFile("evidence meta blank", obj="""Evidence {
metadata: My Metadata
:
}""")
def test_meta_full(self):
self.checkFile("evidence meta full", obj="""Evidence {
metadata: My Metadata
: Is on multiple lines
}""")
def test_hide(self):
self.checkFile("evidence hide", obj="""Evidence {
hidden:
}""")
def test_unhide(self):
self.checkFile("evidence unhide", obj="""Evidence {
hidden:
hidden: dummy
}""")
def test_icon_internal(self):
self.checkFile("evidence internal icon", obj="""Evidence {
icon:: badge
}""")
def test_icon_external(self):
self.checkFile("evidence icon", obj="""Evidence {
icon: my icon
}""")
class ObjectProfiles(ObjectErrors):
folder = "object"
def test_blank(self):
self.checkFile("profile", obj="""Profile {
}""")
def test_long(self):
self.checkFile("profile long", obj="""Profile {
long: Long Name
}""")
def test_short(self):
self.checkFile("profile short", obj="""Profile {
short: Short Name
}""")
def test_descript(self):
self.checkFile("profile descript", obj="""Profile {
description: Description
}""")
def test_descript_plus(self):
self.checkFile("profile descript plus", obj="""Profile {
description: Description
: New stuff
}""")
def test_civil(self):
self.checkFile("profile civil", obj="""Profile {
metadata: Civil Status
}""")
def test_civil_plus(self):
self.checkFile("profile civil plus", obj="""Profile {
metadata: Civil Status
: New stuff
}""")
def test_hide(self):
self.checkFile("profile hide", obj="""Profile {
hidden:
}""")
def test_unhide(self):
self.checkFile("profile unhide", obj="""Profile {
hidden:
hidden: dummy
}""")
def test_sprite(self):
self.checkError((2, "attr name", "sprite"), obj="""Profile {
sprite: dummy
}""")
def test_icon(self):
self.checkFile("profile icon", obj="""Profile {
icon: My Icon
}""")
def test_voice(self):
self.checkFile("profile voice", obj="""Profile {
voice: auto
}""")
def test_voice_crash(self):
self.checkError((2, "bad key", "crash", "voice"), obj="""Profile {
voice: crash
}""")
def test_prefix_crash(self):
self.checkError((2, "not word", "Prefix"), obj="""Profile {
prefix: crash please""")
def test_reserved_prefix(self):
self.checkError((2, "keyword claim", "Prefix", "dispEv"), obj="""Profile {
prefix: dispEv""")
def test_prefix_dupl(self):
self.checkError((9, "prefix dupl", "kumquat"), obj="""Profile {
sprite:: phoenix
prefix: kumquat
}
Profile {
sprite:: phoenix
prefix: kumquat
}""")
def test_suffix_no_prefix(self):
self.checkError((2, "suffix no prefix"), obj="""Profile {
suffix: crash""")
def test_suffix_pos_word(self):
self.checkError((4, "not word", "Suffix foo bar"), obj="""Profile {
sprite:: phoenix
prefix:: phoenix
suffix: normal: foo bar""")
def test_suffix_pos_sprite(self):
self.checkError((4, "unk sprite", "kumquat"), obj="""Profile {
sprite:: phoenix
prefix:: phoenix
suffix: kumquat: foo""")
def test_suffix_rel_word(self):
self.checkError((4, "not word", "Suffix"), obj="""Profile {
sprite:: phoenix
prefix:: phoenix
suffix: normal: foo, bar baz""")
def test_suffix_rel_sprite(self):
self.checkError((4, "excess suffix", "Suffix baz"), obj="""Profile {
sprite:: phoenix
prefix:: phoenix
suffix: superobject: foo, bar, baz""")
def test_suffix_dupl(self):
self.checkError((8, "suffix dupl", "kumquat"), obj="""Profile {
prefix: a
suffix: kumquat
}
Profile {
prefix: b
suffix: kumquat
}""")
class ObjectBadSyntax(ObjectErrors):
def test_grammar_in_object(self):
self.checkError((2, "in obj"), obj="""Place {
this is complete gibberish""")
def test_fake_attr(self):
self.checkError((2, "attr name", "nonsense"), obj="""Place {
Nonsense: command""")
def test_fake_base(self):
self.checkError((2, "attr val", "Command"), obj="""Place {
base: Command""")
def test_fake_default_name(self):
self.checkError((2, "attr name", "nonsense"), obj="""Place {
Nonsense:: pw office""")
def test_fake_default_value(self):
self.checkError((2, "attr val", "objection"), obj="""Place {
name:: objection""")
def test_default_unsupported(self):
self.checkError((2, "no default attr", "volume"), obj="""Music {
volume:: PW1""")
def test_no_continuation(self):
self.checkError((3, "no continuation"), obj="""Music {
name: Text
: Crash!""")
def test_no_duplicate(self):
self.checkError((3, "ban duplicate", "Object", "duplicate"), obj="""Music duplicate {
}
Profile duplicate {""")
def test_no_bad_obj_name(self):
self.checkError((1, "ban obj name", "Evidence"), obj="Profile Evidence {")
def test_no_parent_obj(self):
self.checkError((1, "no parent obj"), obj="foreground {")
def test_missing_parent_obj(self):
self.checkError((1, "parent obj dne", "test"), obj="test foreground {")
def test_bad_subobject(self):
self.checkError((4, "subobj dne", "fake"), obj="""Place object {
}
object fake {""")
def test_invalid_subobj(self):
self.checkError((4, "obj subobj forbid", "sound", "foo"), obj="""Place foo {
}
foo sound {""")
class ObjectComments(ObjectErrors):
folder = "object"
def test_inline_in_obj(self):
self.checkFile("object inline comment out", obj="""// Comment!
Place {
}""")
def test_inline_out_obj(self):
self.checkFile("object inline comment in", obj= """Place {
// Comment!
}""")
def test_block_in_obj(self):
self.checkFile("object block comment out", obj="""/* Comment!*/
Place {
}""")
def test_block_out_obj(self):
self.checkFile("object block comment in", obj="""Place {
/* Comment!*/
}""")
def test_block_block(self):
self.checkFile("object block comment block", obj="""Place {
/* Comment!
Continues!. */
}""")
class ObjectForeBackGround(ObjectErrors):
folder = "subobject"
def test_foreground(self):
self.checkFile("fg", obj="""Place My_Place {
path:: pw office
}
My_Place foreground {
}""")
def test_foreground_2(self):
self.checkFile("fg 2", obj="""Place My_Place {
path:: pw office
}
Place My_Place_2 {
path:: pw office
}
My_Place foreground {
}""")
def test_background(self):
self.checkFile("bg", obj="""Place My_Place {
path:: pw office
}
My_Place background {
}""")
def test_hidden(self):
self.checkFile("bg hide", obj="""Place My_Place {
path:: pw office
}
My_Place background {
hidden: dummy
}""")
def test_unhidden(self):
self.checkFile("bg unhide", obj="""Place My_Place {
path:: pw office
}
My_Place background {
hidden: dummy
hidden: dummy
}""")
def test_x(self):
self.checkFile("bg x", obj="""Place My_Place {
path:: pw office
}
My_Place background {
x: 100
}""")
def test_x_int(self):
self.checkError((6, "int", "x"), obj="""Place My_Place {
path:: pw office
}
My_Place background {
x: upupu""")
def test_y(self):
self.checkFile("bg y", obj="""Place My_Place {
path:: pw office
}
My_Place background {
y: -100
}""")
def test_y_int(self):
self.checkError((6, "int", "y"), obj="""Place My_Place {
path:: pw office
}
My_Place background {
y: upupu""")
def test_name(self):
self.checkFile("bg name", obj="""Place My_Place {
path:: pw office
}
My_Place background {
name: name
}""")
def test_background_default(self):
self.checkFile("bg internal path", obj="""Place My_Place {
path:: pw office
}
My_Place background {
path:: pw judge
}""")
def test_background_path(self):
self.checkFile("bg path", obj="""Place My_Place {
path:: pw office
}
My_Place background {
path: external
}""")
class ObjectEvidencePage(ObjectErrors):
folder = "subobject"
def test_ev_text(self):
self.checkFile("ev text", obj="""Evidence My_Evidence {
}
My_Evidence text {
}""")
def test_ev_image(self):
self.checkFile("ev image", obj="""Evidence My_Evidence {
}
My_Evidence image {
}""")
def test_ev_sound(self):
self.checkFile("ev sound", obj="""Evidence My_Evidence {
}
My_Evidence sound {
}""")
def test_ev_mult_obj(self):
self.checkFile("ev mult obj", obj="""Evidence My_Evidence {
}
Evidence My_Second_Evidence {
}
My_Evidence text {
}""")
def test_ev_mult_subobj(self):
self.checkFile("ev mult subobj", obj="""Evidence My_Evidence {
}
My_Evidence text {
}
My_Evidence image {
}""")
def test_ev_text_content(self):
self.checkFile("ev text content", obj="""Evidence My_Evidence {
}
My_Evidence text {
content: Content
}""")
def test_ev_image_content(self):
self.checkFile("ev image content", obj="""Evidence My_Evidence {
}
My_Evidence image {
content: Content
}""")
def test_ev_text_sound(self):
self.checkFile("ev sound content", obj="""Evidence My_Evidence {
}
My_Evidence sound {
content: Content
}""")
def test_ev_text_cont(self):
self.checkFile("ev text cont", obj="""Evidence My_Evidence {
}
My_Evidence text {
content: Content
: More content
}""")
def test_ev_image_cont(self):
self.checkError((6, "no continuation"), obj="""Evidence My_Evidence {
}
My_Evidence image {
content: Content
: More content
}""")
def test_ev_sound_cont(self):
self.checkError((6, "no continuation"), obj="""Evidence My_Evidence {
}
My_Evidence sound {
content: Content
: More content
}""")
class Object_Sprites(ObjectErrors):
folder = "subobject"
def test_sprite(self):
self.checkFile("sprite", obj="""Profile My_Profile {
}
My_Profile sprite {
}""")
def test_sprite_obj_mult(self):
self.checkFile("sprite obj mult", obj="""Profile My_Profile {
}
Profile My_Second_Profile {
}
My_Profile sprite {
}""")
def test_sprite_subobj_mult(self):
self.checkFile("sprite subobj mult", obj="""Profile My_Profile {
}
My_Profile sprite {
}
My_Profile sprite {
}""")
def test_sprite_name(self):
self.checkFile("sprite name", obj="""Profile My_Profile {
}
My_Profile sprite {
name: Name
}""")
def test_sprite_still(self):
self.checkFile("sprite still", obj="""Profile My_Profile {
}
My_Profile sprite {
still: Still
}""")
def test_sprite_talk(self):
self.checkFile("sprite talk", obj="""Profile My_Profile {
}
My_Profile sprite {
talk: Talk
}""")
def test_sprite_start(self):
self.checkFile("sprite start", obj="""Profile My_Profile {
}
My_Profile sprite {
startup: Start
}""")
def test_sprite_duration_min(self):
self.checkFile("sprite duration min", obj="""Profile My_Profile {
}
My_Profile sprite {
duration: 0
}""")
def test_sprite_duration(self):
self.checkFile("sprite duration", obj="""Profile My_Profile {
}
My_Profile sprite {
duration: 1
}""")
def test_sprite_duration_int(self):
self.checkError((5, "int", "Duration"), obj="""Profile My_Profile {
}
My_Profile sprite {
duration: crash""")
def test_sprite_duration_non_neg(self):
self.checkError((5, "min", "Duration", "0"), obj="""Profile My_Profile {
}
My_Profile sprite {
duration: -1""")
def test_sprite_suffix_word(self):
self.checkError((5, "not word", "Suffix"), obj="""Profile My_Profile {
}
My_Profile sprite {
suffix: Not A Word
}""")
def test_sprite_suffix_no_prefix(self):
self.checkError((5, "suffix no prefix"), obj="""Profile My_Profile {
}
My_Profile sprite {
suffix: Word
}""")
class FrameCoreSpeakerGrammar(FrameErrors):
folder = "frame"
def test_sprite_syntax(self):
self.checkFile("sprite syntax", obj="""Profile {
base: lisabasil
}""", frame="lb2.n")
def test_speaker_syntax(self):
self.checkFile("speaker syntax", obj="""Profile {
base: lisabasil
}""", frame="lb2")
def test_speaker_spriteless(self):
self.checkFile("speaker spriteless", obj="""Profile {
base: dougswallow
}""", frame="ds")
def test_custom_sprite(self):
self.checkFile("custom sprite", obj="""Profile foo {
base: dougswallow
}
foo sprite {
suffix: bar
}""", frame="ds.bar")
def test_sprite_redefined_absolute(self):
self.checkFile("custom suffix abs", obj="""Profile {
base: lisabasil
suffix: happy: foo
}""", frame="lb2.foo")
def test_sprite_redefined_relative(self):
self.checkFile("custom suffix rel", obj="""Profile {
base: lisabasil
suffix: foo
}""", frame="lb2.foo")
def test_null(self):
self.checkFile("null", frame="null")
def test_speaker_dialogue(self):
self.checkFile("speaker dialogue", obj="""Profile {
base: lisabasil
}""", frame="""lb2:
Online.""")
def test_sprite_dialogue(self):
self.checkFile("sprite dialogue", obj="""Profile {
base: lisabasil
}""", frame="""lb2.n:
Online.""")
def test_null_dialogue(self):
self.checkFile("null dialogue", frame="""null:
Online.""")
def test_punctuate(self):
self.checkFile("punctuate", frame="""null:
. ! , - ? ... ; .. : .""")
def test_multi_char_no_place(self):
self.checkError((2, "mult char no place"), obj="""Profile {
sprite:: Phoenix
prefix:: Phoenix
}
Profile {
sprite:: Maya
prefix:: Maya
}""", frame="""pw.n
may.n:""")
def test_multi_char_place(self):
self.checkError((3, "mult char pos"), obj="""Profile {
sprite:: Phoenix
prefix:: Phoenix
}
Profile {
sprite:: Maya
prefix:: Maya
}""", frame="""place, black
pw.n
may.n:""")
def test_terminal_colon_escape(self):
self.checkFile("colon escape", frame="speakerName, myTest\:")
def test_bad_arg_num(self):
self.checkError((1, "bad arg num", "merge"), frame="merge, upupu")
def test_end_merge(self):
self.checkError(("end of file", "terminal merge"), frame="merge")
def test_unk_line_args(self):
self.checkError((1, "unk line"), frame="fake, command")
def test_unk_line_words(self):
self.checkError((1, "unk line"), frame="fake command")
def test_unk_line_word(self):
self.checkError((1, "unk line"), frame="fakecommand")
class Word_Wrap(FrameErrors):
folder = "word wrap"
def test_basic(self):
self.checkFile("basic", frame="""null:
This is my testing of the word wrap functionality. If it works as intended, I will be quite happy.""")
def test_end_pause(self):
self.checkFile("end pause", frame="""null:
This is dialogue.[#200]""")
def test_wordwrap_splitline(self):
self.checkFile("splitline", frame="""null:
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii think this many i is a very bad idea""")
def test_wordwrap_silent(self):
self.checkFile("silent", frame="""null:
This is [#dhigilsgilssststdststgtitstht] fake.""")
def test_wordwrap_overlimit(self):
self.checkFile("over limit", frame="""null:
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i think this many i is a very bad idea""")
def test_wordwrap_underlimit(self):
self.checkFile("under limit", frame="""null:
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i think this many i is a very bad idea""")
def test_wordwrap_overlimit_merge(self):
self.checkFile("over limit merge", frame="""merge:
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
null:
i think this many i is a bad idea""")
def test_wordwrap_underlimit_merge(self):
self.checkFile("under limit merge", frame="""merge:
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
null:
i think this many i is a bad idea""")
def test_wordwrap_break(self):
self.checkFile("linebreak", frame="""null:
It would've restored public trust in
the courts and the jurors' verdicts
would've been just and sensible.""")
def test_delete_term_ellipsis(self):
self.checkFile("ellipsis", frame="""null:
I see…""")
def test_delete_term_four(self):
self.checkFile("four period", frame="""null:
I see....""")
class Frame_Commands(FrameErrors):
folder = "frame"
def test_popup(self):
self.checkFile("popup", obj="""Popup Foo {
}""", frame="popup, Foo")
def test_indent(self):
self.checkFile("popup", obj="""Popup Foo {
}""", frame=" popup, Foo")
def test_popup_no_word(self):
self.checkFile("popup no word", obj="""Popup Foo Bar {
}""", frame="popup, Foo Bar")
def test_popup_escape(self):
self.checkFile("popup escape name", obj="""Popup Foo, Bar {
}""", frame="popup, Foo\, Bar")
def test_popup_not_obj(self):
self.checkError((1, "unk obj", "Foo"), frame="popup, Foo")
def test_popup_not_popup(self):
self.checkError((1, "type in set", "Popup to display", "popups"), obj="""Place Foo {
}""", frame="popup, Foo")
def test_music(self):
self.checkFile("music", obj="""Music Foo {
}""", frame="music, Foo")
def test_music_kill(self):