OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 the V8 project authors. All rights reserved. | 2 # Copyright 2013 the V8 project authors. All rights reserved. |
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 | 10 # copyright notice, this list of conditions and the following |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 67 } |
68 | 68 |
69 | 69 |
70 AUTO_PUSH_ARGS = [ | 70 AUTO_PUSH_ARGS = [ |
71 "-a", "author@chromium.org", | 71 "-a", "author@chromium.org", |
72 "-r", "reviewer@chromium.org", | 72 "-r", "reviewer@chromium.org", |
73 ] | 73 ] |
74 | 74 |
75 | 75 |
76 class ToplevelTest(unittest.TestCase): | 76 class ToplevelTest(unittest.TestCase): |
| 77 def testSaniniziteVersionTags(self): |
| 78 self.assertEquals("4.8.230", SanitizeVersionTag("4.8.230")) |
| 79 self.assertEquals("4.8.230", SanitizeVersionTag("tags/4.8.230")) |
| 80 self.assertEquals(None, SanitizeVersionTag("candidate")) |
| 81 |
| 82 def testNormalizeVersionTags(self): |
| 83 input = ["4.8.230", |
| 84 "tags/4.8.230", |
| 85 "tags/4.8.224.1", |
| 86 "4.8.224.1", |
| 87 "4.8.223.1", |
| 88 "tags/4.8.223", |
| 89 "tags/4.8.231", |
| 90 "candidates"] |
| 91 expected = ["4.8.230", |
| 92 "4.8.230", |
| 93 "4.8.224.1", |
| 94 "4.8.224.1", |
| 95 "4.8.223.1", |
| 96 "4.8.223", |
| 97 "4.8.231", |
| 98 ] |
| 99 self.assertEquals(expected, NormalizeVersionTags(input)) |
| 100 |
77 def testSortBranches(self): | 101 def testSortBranches(self): |
78 S = releases.SortBranches | 102 S = releases.SortBranches |
79 self.assertEquals(["3.1", "2.25"], S(["2.25", "3.1"])[0:2]) | 103 self.assertEquals(["3.1", "2.25"], S(["2.25", "3.1"])[0:2]) |
80 self.assertEquals(["3.0", "2.25"], S(["2.25", "3.0", "2.24"])[0:2]) | 104 self.assertEquals(["3.0", "2.25"], S(["2.25", "3.0", "2.24"])[0:2]) |
81 self.assertEquals(["3.11", "3.2"], S(["3.11", "3.2", "2.24"])[0:2]) | 105 self.assertEquals(["3.11", "3.2"], S(["3.11", "3.2", "2.24"])[0:2]) |
82 | 106 |
83 def testFilterDuplicatesAndReverse(self): | 107 def testFilterDuplicatesAndReverse(self): |
84 F = releases.FilterDuplicatesAndReverse | 108 F = releases.FilterDuplicatesAndReverse |
85 self.assertEquals([], F([])) | 109 self.assertEquals([], F([])) |
86 self.assertEquals([["100", "10"]], F([["100", "10"]])) | 110 self.assertEquals([["100", "10"]], F([["100", "10"]])) |
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 | 1571 |
1548 Review URL: https://codereview.chromium.org/83173002 | 1572 Review URL: https://codereview.chromium.org/83173002 |
1549 | 1573 |
1550 ------------------------------------------------------------------------""") | 1574 ------------------------------------------------------------------------""") |
1551 self.assertEquals( | 1575 self.assertEquals( |
1552 """Prepare push to trunk. Now working on version 3.23.11. | 1576 """Prepare push to trunk. Now working on version 3.23.11. |
1553 | 1577 |
1554 R=danno@chromium.org | 1578 R=danno@chromium.org |
1555 | 1579 |
1556 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1580 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |