~parinporecha/gtg/love_patches

« back to all changes in this revision

Viewing changes to GTG/tests/test_tools_tags.py

  • Committer: Izidor Matušov
  • Date: 2013-01-13 18:44:04 UTC
  • mfrom: (1271.1.4 love_patches!)
  • Revision ID: izidor.matusov@gmail.com-20130113184404-t6dsr3bbjqqwop67
Fix for bug #1095390: Quick Add bar incorrectly parses tags, by Parin Porecha

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        self.assertEqual(tags("some text ended with @endtag"), ["@endtag"])
36
36
 
37
37
    def test_hypen_in_tag(self):
38
 
        self.assertEqual(tags("@tag, @my-tag, bla bla @do-this-today"),
39
 
            ["@tag", "@my-tag", "@do-this-today"])
 
38
        self.assertEqual(tags("@tag, @my-tag, bla bla @do-this-today, it has @con--tinuous---hypen-s-"),
 
39
            ["@tag", "@my-tag", "@do-this-today", "@con--tinuous---hypen-s"])
40
40
 
41
41
        self.assertEqual(tags("@hypen-at-end- some other text"),
42
42
            ["@hypen-at-end"])
44
44
 
45
45
    def test_dot(self):
46
46
        self.assertEqual(tags("text @gtg-0.3"), ["@gtg-0.3"])
47
 
        self.assertEqual(tags("@tag., @my.tag, bla bla @do.this.today"),
48
 
            ["@tag", "@my.tag", "@do.this.today"])
 
47
        self.assertEqual(tags("@tag., @my.tag, bla bla @do.this.today, also contains @hy-pen-.s"),
 
48
            ["@tag", "@my.tag", "@do.this.today", "@hy-pen-.s"])
49
49
 
50
50
    def test_slash(self):
51
 
        self.assertEqual(tags("@tag/, @my/tag, bla bla @do/this/today/"),
52
 
            ["@tag", "@my/tag", "@do/this/today"])
53
 
 
 
51
        self.assertEqual(tags("@tag/, @my/tag, bla bla @do/this/today/, @hy-p-/ens with @slash/es/"),
 
52
            ["@tag", "@my/tag", "@do/this/today", "@hy-p-/ens", "@slash/es"])
 
53
    
 
54
    def test_colon(self):
 
55
        self.assertEqual(tags("@tag:, @my:tag, bla bla @do:this:today:, @co:l-on/s-, @:dot/s:, with @com,mas"),
 
56
            ["@tag", "@my:tag", "@do:this:today", "@co:l-on/s", "@:dot/s", "@com"])
54
57
 
55
58
def test_suite():
56
59
    return unittest.TestLoader().loadTestsFromName(__name__)