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.
5
;; Regression tests for rst-adjust-section-title.
9
;; emacs --script tests-adjust-section.el
11
;; See test-runner.el for documentation on how the format of tests.
14
;; Import the module from the file in the parent directory directly.
15
(add-to-list 'load-path ".")
16
(load "tests-runner.el")
17
(add-to-list 'load-path "..")
20
;; (setq debug-on-error t)
23
(setq rst-line-homogeneous-p-tests
25
;;------------------------------------------------------------------------------
26
(simple "Blablabla bla@" nil)
27
(true "-----------@" ?-)
28
(indented " -----------@" ?-)
29
(letter "aaaa@aaa" ?a)
30
(true2 "uuuuuuuuuuuuuuuuu@" ?u)
31
(misleading "--=---------@" nil)
32
(notstrip " uuuuuuuuuuuuuuuuu@" ?u)
33
(notstrip2 " uuuuuuuuuuuuuuuuu @" ?u)
34
(position "-------@----" ?-)
39
(regression-test-compare-expect-values
40
"Tests for predicate for one char line."
41
rst-line-homogeneous-p-tests 'rst-line-homogeneous-p nil))
43
(setq rst-line-homogeneous-nodent-p-tests
45
;;------------------------------------------------------------------------------
46
(simple "Blablabla bla@" nil)
47
(true "-----------@" ?-)
48
(indented " -----------@" nil)
49
(letter "aaaa@aaa" ?a)
50
(true2 "uuuuuuuuuuuuuuuuu@" ?u)
51
(misleading "--=---------@" nil)
52
(notstrip " uuuuuuuuuuuuuuuuu@" nil)
53
(notstrip2 " uuuuuuuuuuuuuuuuu @" nil)
54
(position "-------@----" ?-)
59
(regression-test-compare-expect-values
60
"Tests for predicate for one char line."
61
rst-line-homogeneous-nodent-p-tests 'rst-line-homogeneous-nodent-p nil))
66
(setq rst-normalize-cursor-position-tests
68
;;------------------------------------------------------------------------------
72
Du bon vin tous les jours.
77
@Du bon vin tous les jours.
82
;;------------------------------------------------------------------------------
86
Du bon vin tous les jours.
91
@Du bon vin tous les jours.
96
;;------------------------------------------------------------------------------
100
Du bon vin tous les jours.
105
@Du bon vin tous les jours.
110
;;------------------------------------------------------------------------------
114
Du bon vin tous les jours.
119
@Du bon vin tous les jours.
124
;;------------------------------------------------------------------------------
128
Du bon vin tous les jours.
134
@Du bon vin tous les jours.
140
;;------------------------------------------------------------------------------
143
Du bon vin tous les jours.
145
Du bon vin tous les jours.
150
@Du bon vin tous les jours.
152
Du bon vin tous les jours.
158
;;------------------------------------------------------------------------------
172
;;------------------------------------------------------------------------------
188
;;------------------------------------------------------------------------------
191
=====================================
192
Project Idea: Panorama Stitcher
193
====================================
195
:Author: Martin Blais <blais@furius.ca>
201
=====================================
202
Project Idea: Panorama Stitcher
203
====================================
205
@:Author: Martin Blais <blais@furius.ca>
216
(regression-test-compare-expect-buffer
217
"Test preparation of cursor position."
218
rst-normalize-cursor-position-tests 'rst-normalize-cursor-position nil))
226
(setq rst-get-decoration-tests
228
;;------------------------------------------------------------------------------
232
@Du bon vin tous les jours
237
;;------------------------------------------------------------------------------
242
Du bon vin tous les jours
247
;;------------------------------------------------------------------------------
251
@ Du bon vin tous les jours
256
;;------------------------------------------------------------------------------
260
@Du bon vin tous les jours
261
=========================
266
;;------------------------------------------------------------------------------
267
(underline-incomplete
270
@Du bon vin tous les jours
276
;;------------------------------------------------------------------------------
280
@ Du bon vin tous les jours
286
;;------------------------------------------------------------------------------
290
@Du bon vin tous les jours
295
;;------------------------------------------------------------------------------
299
@Du bon vin tous les jours
304
;;------------------------------------------------------------------------------
307
~~~~~~~~~~~~~~~~~~~~~~~~~
308
@Du bon vin tous les jours
309
~~~~~~~~~~~~~~~~~~~~~~~~~
312
(?~ over-and-under 0))
314
;;------------------------------------------------------------------------------
316
"~~~~~~~~~~~~~~~~~~~~~~~~~
317
@Du bon vin tous les jours
318
~~~~~~~~~~~~~~~~~~~~~~~~~
321
(?~ over-and-under 0))
323
;;------------------------------------------------------------------------------
324
(over-and-under-indent
326
~~~~~~~~~~~~~~~~~~~~~~~~~
327
@ Du bon vin tous les jours
328
~~~~~~~~~~~~~~~~~~~~~~~~~
331
(?~ over-and-under 3))
333
;;------------------------------------------------------------------------------
334
(over-and-under-incomplete
336
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
337
@Du bon vin tous les jours
341
(?~ over-and-under 0))
343
;;------------------------------------------------------------------------------
344
(over-and-under-different-chars
346
---------------------------
347
@Du bon vin tous les jours
348
~~~~~~~~~~~~~~~~~~~~~~~~~~~
351
(?~ over-and-under 0))
354
;;------------------------------------------------------------------------------
358
Du bon vin to@us les jours
359
=========================
364
;;------------------------------------------------------------------------------
368
=========================
369
Du bon vin tous les jours
370
=========================
374
;;------------------------------------------------------------------------------
377
=========================
378
Du bon vin tous les jours
379
=========================
385
;;------------------------------------------------------------------------------
388
=========================
389
Du bon vin tous les jours
390
=========================
397
;;------------------------------------------------------------------------------
400
=========================
401
Du bon vin tous les jours
402
=========================
408
(45 over-and-under 0))
410
;;------------------------------------------------------------------------------
413
=========================
414
Du bon vin tous les jours
415
=========================
421
(45 over-and-under 2))
423
;;------------------------------------------------------------------------------
427
Du bon vin tous les jours@
428
=========================
437
(regression-test-compare-expect-values
438
"Test getting the decoration."
439
rst-get-decoration-tests 'rst-get-decoration nil))
455
"===============================
456
Project Idea: My Document
457
===============================
459
:Author: Martin Blais
464
This is the introduction.
521
;; ~~~~~~~~~~~~~~~~~~
531
(setq rst-find-all-decorations-tests
533
;;------------------------------------------------------------------------------
535
((2 61 over-and-under 3)
540
(26 126 over-and-under 1)
559
(regression-test-compare-expect-values
560
"Test finding all the decorations in a file."
561
rst-find-all-decorations-tests 'rst-find-all-decorations nil))
566
(setq rst-get-hierarchy-tests
568
;;------------------------------------------------------------------------------
570
((61 over-and-under 3)
573
(126 over-and-under 1))
578
(regression-test-compare-expect-values
579
"Test finding the hierarchy of sections in a file."
580
rst-get-hierarchy-tests 'rst-get-hierarchy nil))
585
(setq rst-get-hierarchy-ignore-tests
587
;;------------------------------------------------------------------------------
589
((61 over-and-under 3)
596
(regression-test-compare-expect-values
597
"Test finding the hierarchy of sections in a file, ignoring lines."
598
rst-get-hierarchy-ignore-tests
599
(lambda () (rst-get-hierarchy nil (line-number-at-pos))) nil))
607
(setq rst-decoration-complete-p-tests
609
;;------------------------------------------------------------------------------
615
" nil ((?= simple 0)))
617
;;------------------------------------------------------------------------------
624
;;------------------------------------------------------------------------------
625
(complete-over-and-under
630
" t ((?= over-and-under 0)))
632
;;------------------------------------------------------------------------------
633
(complete-over-and-under-indent
638
" t ((?= over-and-under 2)))
640
;;------------------------------------------------------------------------------
641
(incomplete-simple-short
645
" nil ((?= simple 0)))
647
;;------------------------------------------------------------------------------
648
(incomplete-simple-long
652
" nil ((?= simple 0)))
654
;;------------------------------------------------------------------------------
655
(incomplete-simple-mixed
659
" nil ((?= simple 0)))
661
;;------------------------------------------------------------------------------
662
(incomplete-over-and-under-1
667
" nil ((?= over-and-under 0)))
669
;;------------------------------------------------------------------------------
670
(incomplete-over-and-under-2
675
" nil ((?= over-and-under 0)))
677
;;------------------------------------------------------------------------------
678
(incomplete-over-and-under-mixed-1
683
" nil ((?= over-and-under 0)))
685
;;------------------------------------------------------------------------------
686
(incomplete-over-and-under-mixed-2
691
" nil ((?= over-and-under 0)))
693
;;------------------------------------------------------------------------------
694
(incomplete-over-only
699
" nil ((?= over-and-under 0)))
701
;;------------------------------------------------------------------------------
707
" nil ((?= over-and-under 0)))
709
;;------------------------------------------------------------------------------
710
(incomplete-over-and-under-1
715
" nil ((?= over-and-under 0)))
717
;;------------------------------------------------------------------------------
718
(incomplete-over-and-under-2
723
" nil ((?= over-and-under 0)))
725
;;------------------------------------------------------------------------------
726
(incomplete-over-and-under-mixed-1
731
" nil ((?= over-and-under 0)))
733
;;------------------------------------------------------------------------------
734
(incomplete-over-and-under-mixed-2
739
" nil ((?= over-and-under 0)))
741
;;------------------------------------------------------------------------------
742
(incomplete-over-only
747
" nil ((?= over-and-under 0)))
749
;;------------------------------------------------------------------------------
755
" nil ((?= over-and-under 0)))
760
(regression-test-compare-expect-values
761
"Tests for completeness predicate."
762
rst-decoration-complete-p-tests 'rst-decoration-complete-p nil))
776
(setq rst-get-decorations-around-tests
778
;;------------------------------------------------------------------------------
790
" ((?- simple 0) (?+ simple 0)))
792
;;------------------------------------------------------------------------------
805
" ((?- simple 0) (?+ simple 0)))
810
(regression-test-compare-expect-values
811
"Tests getting the decorations around a point."
812
rst-get-decorations-around-tests 'rst-get-decorations-around nil))