~ubuntu-branches/ubuntu/karmic/python-docutils/karmic

« back to all changes in this revision

Viewing changes to tools/editors/emacs/tests/tests-adjust-section.el

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;; Authors: Martin Blais <blais@furius.ca>
 
2
;; Date: $Date: 2005/04/01 23:19:41 $
 
3
;; Copyright: This module has been placed in the public domain.
 
4
;;
 
5
;; Regression tests for rst-adjust-section-title.
 
6
;; 
 
7
;; Run this with::
 
8
;;
 
9
;;    emacs --script tests-adjust-section.el
 
10
;;
 
11
;; See test-runner.el for documentation on how the format of tests.
 
12
 
 
13
 
 
14
;; Define tests.
 
15
(setq rst-adjust-decoration-tests
 
16
  '(
 
17
;;------------------------------------------------------------------------------
 
18
(nodec-first-simple-1
 
19
"
 
20
Some Title@
 
21
 
 
22
"
 
23
"
 
24
============
 
25
 Some Title
 
26
============
 
27
 
 
28
"
 
29
)
 
30
 
 
31
;;------------------------------------------------------------------------------
 
32
(nodec-first-simple-2
 
33
"
 
34
Some Title
 
35
@
 
36
"
 
37
"
 
38
============
 
39
 Some Title
 
40
============
 
41
 
 
42
"
 
43
)
 
44
 
 
45
;;------------------------------------------------------------------------------
 
46
(nodec-first-simple-3
 
47
"
 
48
Some Tit@le
 
49
 
 
50
"
 
51
"
 
52
============
 
53
 Some Title
 
54
============
 
55
 
 
56
"
 
57
)
 
58
 
 
59
;;------------------------------------------------------------------------------
 
60
(nodec-first-simple-4
 
61
"
 
62
@Some Title
 
63
 
 
64
"
 
65
"
 
66
============
 
67
 Some Title
 
68
============
 
69
 
 
70
")
 
71
 
 
72
 
 
73
;;------------------------------------------------------------------------------
 
74
(nodec-first-simple-others
 
75
"
 
76
Some Title@
 
77
 
 
78
Other Title
 
79
-----------
 
80
 
 
81
Other Title2
 
82
~~~~~~~~~~~~
 
83
 
 
84
"
 
85
"
 
86
============
 
87
 Some Title
 
88
============
 
89
 
 
90
Other Title
 
91
-----------
 
92
 
 
93
Other Title2
 
94
~~~~~~~~~~~~
 
95
 
 
96
"
 
97
)
 
98
 
 
99
 
 
100
;;------------------------------------------------------------------------------
 
101
(nodec-first-toggle
 
102
"
 
103
Some Title@
 
104
 
 
105
"
 
106
"
 
107
Some Title
 
108
==========
 
109
 
 
110
"
 
111
(t))
 
112
 
 
113
;;------------------------------------------------------------------------------
 
114
(nodec-first-forced
 
115
"
 
116
   Some Title@
 
117
 
 
118
"
 
119
"
 
120
================
 
121
   Some Title
 
122
================
 
123
 
 
124
"
 
125
)
 
126
 
 
127
;;------------------------------------------------------------------------------
 
128
(nodec-first-forced-2
 
129
"
 
130
   Some Title@
 
131
 
 
132
"
 
133
"
 
134
Some Title
 
135
==========
 
136
 
 
137
"
 
138
(t))
 
139
 
 
140
;;------------------------------------------------------------------------------
 
141
(nodec-simple
 
142
"
 
143
Previous Title
 
144
--------------
 
145
 
 
146
Some Title@
 
147
 
 
148
"
 
149
"
 
150
Previous Title
 
151
--------------
 
152
 
 
153
Some Title
 
154
~~~~~~~~~~
 
155
 
 
156
"
 
157
)
 
158
 
 
159
;;------------------------------------------------------------------------------
 
160
(nodec-simple-neg
 
161
"
 
162
Previous Title
 
163
--------------
 
164
 
 
165
Some Title@
 
166
 
 
167
Next Title
 
168
~~~~~~~~~~
 
169
 
 
170
"
 
171
"
 
172
Previous Title
 
173
--------------
 
174
 
 
175
Some Title
 
176
~~~~~~~~~~
 
177
 
 
178
Next Title
 
179
~~~~~~~~~~
 
180
 
 
181
"
 
182
)
 
183
 
 
184
;;------------------------------------------------------------------------------
 
185
(nodec-simple-toggle
 
186
"
 
187
Previous Title
 
188
--------------
 
189
 
 
190
Some Title@
 
191
 
 
192
"
 
193
"
 
194
Previous Title
 
195
--------------
 
196
 
 
197
~~~~~~~~~~
 
198
Some Title
 
199
~~~~~~~~~~
 
200
 
 
201
"
 
202
(t))
 
203
 
 
204
;;------------------------------------------------------------------------------
 
205
(nodec-simple-force-toggle
 
206
"
 
207
Previous Title
 
208
--------------
 
209
 
 
210
  Some Title@
 
211
 
 
212
"
 
213
"
 
214
Previous Title
 
215
--------------
 
216
 
 
217
~~~~~~~~~~~~~~
 
218
  Some Title
 
219
~~~~~~~~~~~~~~
 
220
 
 
221
"
 
222
(t))
 
223
 
 
224
 
 
225
;;------------------------------------------------------------------------------
 
226
(nodec-simple-forced
 
227
"
 
228
Previous Title
 
229
--------------
 
230
 
 
231
   Some Title@
 
232
 
 
233
"
 
234
"
 
235
Previous Title
 
236
--------------
 
237
 
 
238
Some Title
 
239
~~~~~~~~~~
 
240
 
 
241
"
 
242
)
 
243
 
 
244
;;------------------------------------------------------------------------------
 
245
(nodec-neg
 
246
"
 
247
Previous Title
 
248
--------------
 
249
 
 
250
Some Title@
 
251
 
 
252
Next Title
 
253
~~~~~~~~~~
 
254
"
 
255
"
 
256
Previous Title
 
257
--------------
 
258
 
 
259
Some Title
 
260
----------
 
261
 
 
262
Next Title
 
263
~~~~~~~~~~
 
264
"
 
265
(-1))
 
266
 
 
267
;;------------------------------------------------------------------------------
 
268
(incomplete-simple-1
 
269
"
 
270
Previous Title@
 
271
----------
 
272
"
 
273
"
 
274
Previous Title
 
275
--------------
 
276
 
 
277
"
 
278
)
 
279
 
 
280
;;------------------------------------------------------------------------------
 
281
(incomplete-simple-2
 
282
"
 
283
Previous Title
 
284
----------@
 
285
"
 
286
"
 
287
Previous Title
 
288
--------------
 
289
 
 
290
"
 
291
)
 
292
 
 
293
;;------------------------------------------------------------------------------
 
294
(incomplete-simple-3
 
295
"
 
296
Previous Title
 
297
-@
 
298
"
 
299
"
 
300
================
 
301
 Previous Title
 
302
================
 
303
 
 
304
"
 
305
)
 
306
 
 
307
;;------------------------------------------------------------------------------
 
308
(incomplete-simple-too-long
 
309
"
 
310
Previous Title
 
311
------------------@
 
312
"
 
313
"
 
314
Previous Title
 
315
--------------
 
316
 
 
317
"
 
318
)
 
319
 
 
320
;;------------------------------------------------------------------------------
 
321
(incomplete-simple-uo
 
322
"
 
323
----------------
 
324
 Previous Title
 
325
----------@
 
326
"
 
327
"
 
328
----------------
 
329
 Previous Title
 
330
----------------
 
331
 
 
332
"
 
333
)
 
334
 
 
335
;;------------------------------------------------------------------------------
 
336
(incomplete-partial-overline
 
337
"
 
338
----------@
 
339
 Previous Title
 
340
----------------
 
341
"
 
342
"
 
343
----------------
 
344
 Previous Title
 
345
----------------
 
346
 
 
347
"
 
348
)
 
349
 
 
350
;;------------------------------------------------------------------------------
 
351
(incomplete-both
 
352
"
 
353
----------
 
354
 Previous Title@
 
355
-----
 
356
"
 
357
"
 
358
----------------
 
359
 Previous Title
 
360
----------------
 
361
 
 
362
"
 
363
)
 
364
 
 
365
;;------------------------------------------------------------------------------
 
366
(incomplete-toggle
 
367
"
 
368
Previous Title
 
369
----------@
 
370
"
 
371
"
 
372
--------------
 
373
Previous Title
 
374
--------------
 
375
 
 
376
"
 
377
(t))
 
378
 
 
379
;;------------------------------------------------------------------------------
 
380
(incomplete-toggle-2
 
381
"
 
382
----------------
 
383
 Previous Title@
 
384
--------
 
385
"
 
386
"
 
387
Previous Title
 
388
--------------
 
389
 
 
390
"
 
391
(t))
 
392
 
 
393
;;------------------------------------------------------------------------------
 
394
(incomplete-toggle-overline
 
395
"
 
396
--------@
 
397
 Previous Title
 
398
----------------
 
399
"
 
400
"
 
401
Previous Title
 
402
--------------
 
403
 
 
404
"
 
405
(t))
 
406
 
 
407
;;------------------------------------------------------------------------------
 
408
(incomplete-top
 
409
"--------@
 
410
 Previous Title
 
411
----------------
 
412
"
 
413
"----------------
 
414
 Previous Title
 
415
----------------
 
416
 
 
417
"
 
418
)
 
419
 
 
420
;;------------------------------------------------------------------------------
 
421
(incomplete-top-2
 
422
"=======
 
423
Document Title@
 
424
==============
 
425
"
 
426
"==============
 
427
Document Title
 
428
==============
 
429
 
 
430
"
 
431
)
 
432
 
 
433
;;------------------------------------------------------------------------------
 
434
(complete-simple
 
435
"
 
436
================
 
437
 Document Title
 
438
================
 
439
 
 
440
SubTitle
 
441
--------
 
442
 
 
443
My Title@
 
444
--------
 
445
 
 
446
After Title
 
447
~~~~~~~~~~~
 
448
 
 
449
"
 
450
"
 
451
================
 
452
 Document Title
 
453
================
 
454
 
 
455
SubTitle
 
456
--------
 
457
 
 
458
==========
 
459
 My Title
 
460
==========
 
461
 
 
462
After Title
 
463
~~~~~~~~~~~
 
464
 
 
465
"
 
466
)
 
467
 
 
468
;;------------------------------------------------------------------------------
 
469
(complete-simple-neg
 
470
"
 
471
================
 
472
 Document Title
 
473
================
 
474
 
 
475
SubTitle
 
476
--------
 
477
 
 
478
My Title@
 
479
--------
 
480
 
 
481
After Title
 
482
~~~~~~~~~~~
 
483
 
 
484
"
 
485
"
 
486
================
 
487
 Document Title
 
488
================
 
489
 
 
490
SubTitle
 
491
--------
 
492
 
 
493
My Title
 
494
~~~~~~~~
 
495
 
 
496
After Title
 
497
~~~~~~~~~~~
 
498
 
 
499
"
 
500
(-1))
 
501
 
 
502
;;------------------------------------------------------------------------------
 
503
(complete-simple-suggestion-down
 
504
"
 
505
================
 
506
 Document Title
 
507
================
 
508
 
 
509
SubTitle
 
510
========
 
511
 
 
512
My Title@
 
513
========
 
514
 
 
515
"
 
516
"
 
517
================
 
518
 Document Title
 
519
================
 
520
 
 
521
SubTitle
 
522
========
 
523
 
 
524
My Title
 
525
--------
 
526
 
 
527
"
 
528
(-1))
 
529
 
 
530
;;------------------------------------------------------------------------------
 
531
(complete-simple-boundary-down
 
532
"
 
533
================
 
534
 Document Title
 
535
================
 
536
 
 
537
SubTitle
 
538
========
 
539
 
 
540
My Title@
 
541
--------
 
542
 
 
543
"
 
544
"
 
545
================
 
546
 Document Title
 
547
================
 
548
 
 
549
SubTitle
 
550
========
 
551
 
 
552
==========
 
553
 My Title
 
554
==========
 
555
 
 
556
"
 
557
(-1))
 
558
 
 
559
;;------------------------------------------------------------------------------
 
560
(complete-simple-suggestion-up
 
561
"
 
562
================
 
563
 Document Title
 
564
================
 
565
 
 
566
SubTitle
 
567
========
 
568
 
 
569
==========
 
570
 My Title@
 
571
==========
 
572
 
 
573
"
 
574
"
 
575
================
 
576
 Document Title
 
577
================
 
578
 
 
579
SubTitle
 
580
========
 
581
 
 
582
My Title
 
583
--------
 
584
 
 
585
"
 
586
)
 
587
 
 
588
;;------------------------------------------------------------------------------
 
589
(complete-simple-boundary-up ;; Note: boundary-up does not exist.
 
590
"
 
591
================
 
592
 Document Title
 
593
================
 
594
 
 
595
SubTitle
 
596
========
 
597
 
 
598
My Title@
 
599
--------
 
600
"
 
601
"
 
602
================
 
603
 Document Title
 
604
================
 
605
 
 
606
SubTitle
 
607
========
 
608
 
 
609
My Title
 
610
========
 
611
 
 
612
"
 
613
)
 
614
 
 
615
;;------------------------------------------------------------------------------
 
616
(complete-toggle-1
 
617
"
 
618
SubTitle@
 
619
~~~~~~~~
 
620
 
 
621
"
 
622
"
 
623
~~~~~~~~~~
 
624
 SubTitle
 
625
~~~~~~~~~~
 
626
 
 
627
"
 
628
(t))
 
629
 
 
630
;;------------------------------------------------------------------------------
 
631
(complete-toggle-2
 
632
"
 
633
~~~~~~~~~~
 
634
 SubTitle@
 
635
~~~~~~~~~~
 
636
 
 
637
"
 
638
"
 
639
SubTitle
 
640
~~~~~~~~
 
641
 
 
642
"
 
643
(t))
 
644
 
 
645
;;------------------------------------------------------------------------------
 
646
(at-file-beginning
 
647
"
 
648
Document Title@
 
649
 
 
650
"
 
651
"
 
652
================
 
653
 Document Title@
 
654
================
 
655
 
 
656
"
 
657
)
 
658
 
 
659
 
 
660
;;------------------------------------------------------------------------------
 
661
(at-file-ending
 
662
"
 
663
 
 
664
Document Title@
 
665
"
 
666
"
 
667
 
 
668
================
 
669
 Document Title@
 
670
================
 
671
 
 
672
"
 
673
)
 
674
 
 
675
;;------------------------------------------------------------------------------
 
676
(at-file-ending-2
 
677
"
 
678
 
 
679
Document Title@"
 
680
"
 
681
 
 
682
================
 
683
 Document Title@
 
684
================
 
685
"
 
686
)
 
687
 
 
688
;;------------------------------------------------------------------------------
 
689
(conjoint
 
690
"
 
691
Document Title
 
692
==============
 
693
Subtitle@
 
694
 
 
695
"
 
696
"
 
697
Document Title
 
698
==============
 
699
Subtitle@
 
700
--------
 
701
 
 
702
"
 
703
)
 
704
 
 
705
;;------------------------------------------------------------------------------
 
706
(same-conjoint-2
 
707
"==============
 
708
Document Title@
 
709
==============
 
710
Subtitle
 
711
========
 
712
 
 
713
"
 
714
"Document Title@
 
715
==============
 
716
Subtitle
 
717
========
 
718
 
 
719
"
 
720
)
 
721
 
 
722
;;------------------------------------------------------------------------------
 
723
(same-conjoint-2b
 
724
"
 
725
==============
 
726
Document Title@
 
727
==============
 
728
Subtitle
 
729
========
 
730
 
 
731
"
 
732
"
 
733
Document Title@
 
734
==============
 
735
Subtitle
 
736
========
 
737
 
 
738
"
 
739
)
 
740
 
 
741
 
 
742
;;------------------------------------------------------------------------------
 
743
(same-conjoint-2
 
744
"
 
745
==============
 
746
Document Title
 
747
==============
 
748
===============
 
749
Document Title2@
 
750
===============
 
751
 
 
752
"
 
753
"
 
754
==============
 
755
Document Title
 
756
==============
 
757
Document Title2
 
758
===============
 
759
 
 
760
"
 
761
)
 
762
 
 
763
;; FIXME: todo
 
764
;; ;;------------------------------------------------------------------------------
 
765
;; (cycle-previous-only
 
766
;; "
 
767
;; ==================
 
768
;;   Document Title
 
769
;; ==================
 
770
;; 
 
771
;; Document Title2
 
772
;; ===============
 
773
;; 
 
774
;; =======
 
775
;;   Bli@
 
776
;; =======
 
777
;; 
 
778
;; Document Title2
 
779
;; ===============
 
780
;; 
 
781
;; Document Title3
 
782
;; ---------------
 
783
;; 
 
784
;; Document Title4
 
785
;; ~~~~~~~~~~~~~~~
 
786
;; 
 
787
;; "
 
788
;; "
 
789
;; ==================
 
790
;;   Document Title
 
791
;; ==================
 
792
;; 
 
793
;; Document Title2
 
794
;; ===============
 
795
;; 
 
796
;; Bli@
 
797
;; ---
 
798
;; 
 
799
;; Document Title2
 
800
;; ===============
 
801
;; 
 
802
;; Document Title3
 
803
;; ---------------
 
804
;; 
 
805
;; Document Title4
 
806
;; ~~~~~~~~~~~~~~~
 
807
;; 
 
808
;; "
 
809
;; )
 
810
 
 
811
))
 
812
 
 
813
 
 
814
;; Main program.  Evaluate this to run the tests.
 
815
;; (setq debug-on-error t)
 
816
 
 
817
;; Import the module from the file in the parent directory directly.
 
818
(add-to-list 'load-path ".")
 
819
(load "tests-runner.el")
 
820
(add-to-list 'load-path "..")
 
821
(load "rst.el")
 
822
 
 
823
(progn
 
824
  (regression-test-compare-expect-buffer
 
825
   "Test interactive adjustment of sections."
 
826
   rst-adjust-decoration-tests
 
827
   (lambda ()
 
828
     (call-interactively 'rst-adjust))
 
829
   nil))
 
830