OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 12 matching lines...) Expand all Loading... |
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 |
29 import unittest | 29 import unittest |
30 | 30 |
31 from webkitpy.tool import grammar | 31 from webkitpy.tool import grammar |
32 | 32 |
| 33 |
33 class GrammarTest(unittest.TestCase): | 34 class GrammarTest(unittest.TestCase): |
34 | 35 |
35 def test_join_with_separators_zero(self): | 36 def test_join_with_separators_zero(self): |
36 self.assertEqual( | 37 self.assertEqual( |
37 "", | 38 "", |
38 grammar.join_with_separators([])) | 39 grammar.join_with_separators([])) |
39 | 40 |
40 def test_join_with_separators_one(self): | 41 def test_join_with_separators_one(self): |
41 self.assertEqual( | 42 self.assertEqual( |
42 "one", | 43 "one", |
(...skipping 13 matching lines...) Expand all Loading... |
56 self.assertEqual("0 tests", grammar.pluralize("test", 0)) | 57 self.assertEqual("0 tests", grammar.pluralize("test", 0)) |
57 | 58 |
58 def test_pluralize_one(self): | 59 def test_pluralize_one(self): |
59 self.assertEqual("1 test", grammar.pluralize("test", 1)) | 60 self.assertEqual("1 test", grammar.pluralize("test", 1)) |
60 | 61 |
61 def test_pluralize_two(self): | 62 def test_pluralize_two(self): |
62 self.assertEqual("2 tests", grammar.pluralize("test", 2)) | 63 self.assertEqual("2 tests", grammar.pluralize("test", 2)) |
63 | 64 |
64 def test_pluralize_two_ends_with_sh(self): | 65 def test_pluralize_two_ends_with_sh(self): |
65 self.assertEqual("2 crashes", grammar.pluralize("crash", 2)) | 66 self.assertEqual("2 crashes", grammar.pluralize("crash", 2)) |
OLD | NEW |