for git v1.5.2 (and below): chdir to the directory of the target file before executin...
[translate_toolkit.git] / lang / test_af.py
blob826c5d0583e99b09d4aa72d310e17582d1a0f099
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 from translate.lang import factory
6 def test_sentences():
7 """Tests basic functionality of sentence segmentation."""
8 language = factory.getlanguage('af')
9 sentences = language.sentences(u"Normal case. Nothing interesting.")
10 assert sentences == [u"Normal case.", "Nothing interesting."]
11 sentences = language.sentences(u"Wat? 'n Fout?")
12 assert sentences == [u"Wat?", "'n Fout?"]
13 sentences = language.sentences(u"Dit sal a.g.v. 'n fout gebeur.")
14 assert sentences == [u"Dit sal a.g.v. 'n fout gebeur."]
16 def test_capsstart():
17 """Tests that the indefinite article ('n) doesn't confuse startcaps()."""
18 language = factory.getlanguage('af')
19 assert language.capsstart("Koeie kraam koeie")
20 assert language.capsstart("'Koeie' kraam koeie")
21 assert not language.capsstart("koeie kraam koeie")
22 assert language.capsstart("\n\nKoeie kraam koeie")
23 assert language.capsstart("'n Koei kraam koeie")
24 assert language.capsstart("'n 'Koei' kraam koeie")
25 assert not language.capsstart("'n koei kraam koeie")
26 assert language.capsstart("\n\n'n Koei kraam koeie")