summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-08-04 20:07:20 +0300
committerSergey Poznyakoff <gray@gnu.org>2018-08-04 20:07:20 +0300
commitca53e0361ac27a532017057faa7e417fe1bc80bb (patch)
tree9706377a7802756d48422d14e6366ec668ce8db9
parent4c0ff8e5b4f7000ca8db70bd8555a7e6a85875d0 (diff)
downloadwikitrans-ca53e0361ac27a532017057faa7e417fe1bc80bb.tar.gz
wikitrans-ca53e0361ac27a532017057faa7e417fe1bc80bb.tar.bz2
Add testsuite for texi translator
-rw-r--r--testdata/bold.texi1
-rw-r--r--testdata/boldit0.texi1
-rw-r--r--testdata/boldit1.texi1
-rw-r--r--testdata/boldit2.texi1
-rw-r--r--testdata/boldit3.texi1
-rw-r--r--testdata/colon.texi11
-rw-r--r--testdata/deflist.texi12
-rw-r--r--testdata/header0.texi5
-rw-r--r--testdata/headings.texi22
-rw-r--r--testdata/hz.texi8
-rw-r--r--testdata/it.texi1
-rw-r--r--testdata/itbold1.texi1
-rw-r--r--testdata/itbold2.texi1
-rw-r--r--testdata/itbold3.texi1
-rw-r--r--testdata/link.texi1
-rw-r--r--testdata/nowiki-tag.texi1
-rw-r--r--testdata/nowiki.texi1
-rw-r--r--testdata/numlist.texi19
-rw-r--r--testdata/para.texi5
-rw-r--r--testdata/unlist.texi26
-rw-r--r--tests/test_texi.py14
21 files changed, 134 insertions, 0 deletions
diff --git a/testdata/bold.texi b/testdata/bold.texi
new file mode 100644
index 0000000..2bcd4c2
--- /dev/null
+++ b/testdata/bold.texi
@@ -0,0 +1 @@
now is the time for @b{all good} men to come to
diff --git a/testdata/boldit0.texi b/testdata/boldit0.texi
new file mode 100644
index 0000000..12f8b74
--- /dev/null
+++ b/testdata/boldit0.texi
@@ -0,0 +1 @@
now is the time for @i{@b{all good}} men to come to
diff --git a/testdata/boldit1.texi b/testdata/boldit1.texi
new file mode 100644
index 0000000..486baf9
--- /dev/null
+++ b/testdata/boldit1.texi
@@ -0,0 +1 @@
@b{a b @i{c} d}
diff --git a/testdata/boldit2.texi b/testdata/boldit2.texi
new file mode 100644
index 0000000..0ca1faa
--- /dev/null
+++ b/testdata/boldit2.texi
@@ -0,0 +1 @@
@b{@i{a b} c d}
diff --git a/testdata/boldit3.texi b/testdata/boldit3.texi
new file mode 100644
index 0000000..f594ba3
--- /dev/null
+++ b/testdata/boldit3.texi
@@ -0,0 +1 @@
@b{a b @i{c d}}
diff --git a/testdata/colon.texi b/testdata/colon.texi
new file mode 100644
index 0000000..fc7e4e1
--- /dev/null
+++ b/testdata/colon.texi
@@ -0,0 +1,11 @@
1
2@w{ }A colon (:) indents a line or paragraph.
3
4A newline starts a new paragraph.
5Should only be used on talk pages.
6For articles, you probably want the blockquote tag.
7
8@w{ }We use 1 colon to indent once.
9@w{ }@w{ }We use 2 colons to indent twice.
10@w{ }@w{ }@w{ }3 colons to indent 3 times, and so on.
11
diff --git a/testdata/deflist.texi b/testdata/deflist.texi
new file mode 100644
index 0000000..73ff806
--- /dev/null
+++ b/testdata/deflist.texi
@@ -0,0 +1,12 @@
1
2@table @asis
3@item item 1
4definition 1
5
6@item item 2
7definition 2-1
8
9definition 2-2
10
11@end table
12
diff --git a/testdata/header0.texi b/testdata/header0.texi
new file mode 100644
index 0000000..ca5788d
--- /dev/null
+++ b/testdata/header0.texi
@@ -0,0 +1,5 @@
1
2@section Header
3@node Header
4
5Paragraph.
diff --git a/testdata/headings.texi b/testdata/headings.texi
new file mode 100644
index 0000000..a9f372d
--- /dev/null
+++ b/testdata/headings.texi
@@ -0,0 +1,22 @@
1
2@section Section headings
3@node Section headings
4
5@i{Headings} organize your writing into
6sections. The Wiki software can automatically
7generate a @ref{table of contents} from them.
8
9@subsection Subsection
10@node Subsection
11
12Using more "equals" (=) signs creates a subsection.
13
14@subsubsection A smaller subsection
15@node A smaller subsection
16
17Don't skip levels,
18like from two to four equals signs.
19
20Start with 2 equals signs not 1
21because 1 creates H1 tags
22which should be reserved for page title.
diff --git a/testdata/hz.texi b/testdata/hz.texi
new file mode 100644
index 0000000..e13f032
--- /dev/null
+++ b/testdata/hz.texi
@@ -0,0 +1,8 @@
1You can make horizontal dividing lines (----)
2to separate text.
3
4
5-----
6
7But you should usually use sections instead,
8so that they go in the table of contents.
diff --git a/testdata/it.texi b/testdata/it.texi
new file mode 100644
index 0000000..e77394b
--- /dev/null
+++ b/testdata/it.texi
@@ -0,0 +1 @@
now is the time for @i{all good} men to come to
diff --git a/testdata/itbold1.texi b/testdata/itbold1.texi
new file mode 100644
index 0000000..d78c85c
--- /dev/null
+++ b/testdata/itbold1.texi
@@ -0,0 +1 @@
@i{a b @b{c} d}
diff --git a/testdata/itbold2.texi b/testdata/itbold2.texi
new file mode 100644
index 0000000..50eec2a
--- /dev/null
+++ b/testdata/itbold2.texi
@@ -0,0 +1 @@
@i{@b{a b} c d}
diff --git a/testdata/itbold3.texi b/testdata/itbold3.texi
new file mode 100644
index 0000000..afe3bf5
--- /dev/null
+++ b/testdata/itbold3.texi
@@ -0,0 +1 @@
@i{a b @b{c d}}
diff --git a/testdata/link.texi b/testdata/link.texi
new file mode 100644
index 0000000..a9db988
--- /dev/null
+++ b/testdata/link.texi
@@ -0,0 +1 @@
@ref{link,foo} is a simple link.
diff --git a/testdata/nowiki-tag.texi b/testdata/nowiki-tag.texi
new file mode 100644
index 0000000..0da9cab
--- /dev/null
+++ b/testdata/nowiki-tag.texi
@@ -0,0 +1 @@
A <tag>
diff --git a/testdata/nowiki.texi b/testdata/nowiki.texi
new file mode 100644
index 0000000..0b341a8
--- /dev/null
+++ b/testdata/nowiki.texi
@@ -0,0 +1 @@
#:version=1.0@i{rest} of line
diff --git a/testdata/numlist.texi b/testdata/numlist.texi
new file mode 100644
index 0000000..738f72e
--- /dev/null
+++ b/testdata/numlist.texi
@@ -0,0 +1,19 @@
1
2@enumerate
3@item @i{Numbered lists} are:
4@enumerate
5@item Very organized
6
7@item Easy to follow
8
9@end enumerate
10
11@end enumerate
12
13A newline marks the end of the list.
14
15@enumerate
16@item New numbering starts with 1.
17
18@end enumerate
19
diff --git a/testdata/para.texi b/testdata/para.texi
new file mode 100644
index 0000000..04395d4
--- /dev/null
+++ b/testdata/para.texi
@@ -0,0 +1,5 @@
1First paragraph consists of two sentences.
2Each sentence occupies a line.
3
4Second paragraph consists of two sentences as well.
5Each of them, again, occupies its own line.
diff --git a/testdata/unlist.texi b/testdata/unlist.texi
new file mode 100644
index 0000000..4cda102
--- /dev/null
+++ b/testdata/unlist.texi
@@ -0,0 +1,26 @@
1
2@itemize @bullet
3@item @i{Unordered lists} are easy to do:
4@itemize @bullet
5@item Start every line with a star.
6@itemize @bullet
7@item More stars indicate a deeper level.
8
9@end itemize
10Previous item continues.
11
12@item A newline
13
14@end itemize
15
16@item in a list
17
18@end itemize
19
20marks the end of the list.
21
22@itemize @bullet
23@item Of course you can start again.
24
25@end itemize
26
diff --git a/tests/test_texi.py b/tests/test_texi.py
new file mode 100644
index 0000000..75314c9
--- /dev/null
+++ b/tests/test_texi.py
@@ -0,0 +1,14 @@
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3from __future__ import print_function
4import unittest
5from WikiTrans.wiki2texi import TexiWikiMarkup
6from WikiTest import populateMethods
7
8class TestTexiWikiMarkup (unittest.TestCase):
9 pass
10
11populateMethods(TestTexiWikiMarkup, TexiWikiMarkup, '.texi')
12
13if __name__ == '__main__':
14 unittest.main()

Return to:

Send suggestions and report system problems to the System administrator.