summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2018-08-04 17:07:20 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-08-04 17:07:20 (GMT)
commitca53e0361ac27a532017057faa7e417fe1bc80bb (patch) (side-by-side diff)
tree9706377a7802756d48422d14e6366ec668ce8db9
parent4c0ff8e5b4f7000ca8db70bd8555a7e6a85875d0 (diff)
downloadwikitrans-ca53e0361ac27a532017057faa7e417fe1bc80bb.tar.gz
wikitrans-ca53e0361ac27a532017057faa7e417fe1bc80bb.tar.bz2
Add testsuite for texi translator
Diffstat (more/less context) (show whitespace changes)
-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
--- a/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
--- a/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
--- a/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
--- a/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
--- a/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
--- a/dev/null
+++ b/testdata/colon.texi
@@ -0,0 +1,11 @@
+
+@w{ }A colon (:) indents a line or paragraph.
+
+A newline starts a new paragraph.
+Should only be used on talk pages.
+For articles, you probably want the blockquote tag.
+
+@w{ }We use 1 colon to indent once.
+@w{ }@w{ }We use 2 colons to indent twice.
+@w{ }@w{ }@w{ }3 colons to indent 3 times, and so on.
+
diff --git a/testdata/deflist.texi b/testdata/deflist.texi
new file mode 100644
index 0000000..73ff806
--- a/dev/null
+++ b/testdata/deflist.texi
@@ -0,0 +1,12 @@
+
+@table @asis
+@item item 1
+definition 1
+
+@item item 2
+definition 2-1
+
+definition 2-2
+
+@end table
+
diff --git a/testdata/header0.texi b/testdata/header0.texi
new file mode 100644
index 0000000..ca5788d
--- a/dev/null
+++ b/testdata/header0.texi
@@ -0,0 +1,5 @@
+
+@section Header
+@node Header
+
+Paragraph.
diff --git a/testdata/headings.texi b/testdata/headings.texi
new file mode 100644
index 0000000..a9f372d
--- a/dev/null
+++ b/testdata/headings.texi
@@ -0,0 +1,22 @@
+
+@section Section headings
+@node Section headings
+
+@i{Headings} organize your writing into
+sections. The Wiki software can automatically
+generate a @ref{table of contents} from them.
+
+@subsection Subsection
+@node Subsection
+
+Using more "equals" (=) signs creates a subsection.
+
+@subsubsection A smaller subsection
+@node A smaller subsection
+
+Don't skip levels,
+like from two to four equals signs.
+
+Start with 2 equals signs not 1
+because 1 creates H1 tags
+which should be reserved for page title.
diff --git a/testdata/hz.texi b/testdata/hz.texi
new file mode 100644
index 0000000..e13f032
--- a/dev/null
+++ b/testdata/hz.texi
@@ -0,0 +1,8 @@
+You can make horizontal dividing lines (----)
+to separate text.
+
+
+-----
+
+But you should usually use sections instead,
+so 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
--- a/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
--- a/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
--- a/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
--- a/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
--- a/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
--- a/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
--- a/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
--- a/dev/null
+++ b/testdata/numlist.texi
@@ -0,0 +1,19 @@
+
+@enumerate
+@item @i{Numbered lists} are:
+@enumerate
+@item Very organized
+
+@item Easy to follow
+
+@end enumerate
+
+@end enumerate
+
+A newline marks the end of the list.
+
+@enumerate
+@item New numbering starts with 1.
+
+@end enumerate
+
diff --git a/testdata/para.texi b/testdata/para.texi
new file mode 100644
index 0000000..04395d4
--- a/dev/null
+++ b/testdata/para.texi
@@ -0,0 +1,5 @@
+First paragraph consists of two sentences.
+Each sentence occupies a line.
+
+Second paragraph consists of two sentences as well.
+Each of them, again, occupies its own line.
diff --git a/testdata/unlist.texi b/testdata/unlist.texi
new file mode 100644
index 0000000..4cda102
--- a/dev/null
+++ b/testdata/unlist.texi
@@ -0,0 +1,26 @@
+
+@itemize @bullet
+@item @i{Unordered lists} are easy to do:
+@itemize @bullet
+@item Start every line with a star.
+@itemize @bullet
+@item More stars indicate a deeper level.
+
+@end itemize
+Previous item continues.
+
+@item A newline
+
+@end itemize
+
+@item in a list
+
+@end itemize
+
+marks the end of the list.
+
+@itemize @bullet
+@item Of course you can start again.
+
+@end itemize
+
diff --git a/tests/test_texi.py b/tests/test_texi.py
new file mode 100644
index 0000000..75314c9
--- a/dev/null
+++ b/tests/test_texi.py
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+from __future__ import print_function
+import unittest
+from WikiTrans.wiki2texi import TexiWikiMarkup
+from WikiTest import populateMethods
+
+class TestTexiWikiMarkup (unittest.TestCase):
+ pass
+
+populateMethods(TestTexiWikiMarkup, TexiWikiMarkup, '.texi')
+
+if __name__ == '__main__':
+ unittest.main()

Return to:

Send suggestions and report system problems to the System administrator.