Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: tools/lexer_generator/transition_key_test.py

Issue 54533002: Experimental parser: more tests, better key logic (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/lexer_generator/nfa.py ('k') | tools/lexer_generator/transition_keys.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/transition_key_test.py
diff --git a/WATCHLISTS b/tools/lexer_generator/transition_key_test.py
similarity index 73%
copy from WATCHLISTS
copy to tools/lexer_generator/transition_key_test.py
index 9c2bce9c5589c22649b4a2c94837f00c8d669be1..00863bf11dd3e8455dae81c3c4e637723b421704 100644
--- a/WATCHLISTS
+++ b/tools/lexer_generator/transition_key_test.py
@@ -25,22 +25,24 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# Watchlist Rules
-# Refer: http://dev.chromium.org/developers/contributing-code/watchlists
+import unittest
+from transition_keys import TransitionKey
-# IMPORTANT: The regular expression filepath is tested against each path using
-# re.search, so it is not usually necessary to add .*.
+class TransitionKeyTestCase(unittest.TestCase):
-{
- 'WATCHLIST_DEFINITIONS': {
- 'public_api': {
- 'filepath': 'include/',
- },
- },
+ __equal_pairs = [
+ (TransitionKey.epsilon(), TransitionKey.epsilon()),
+ (TransitionKey.any(), TransitionKey.any()),
+ (TransitionKey.single_char('a'), TransitionKey.single_char('a')),
+ ]
- 'WATCHLISTS': {
- 'public_api': [
- 'phajdan.jr@chromium.org',
- ],
- },
-}
+ def test_eq(self):
+ for (left, right) in self.__equal_pairs:
+ self.assertEqual(left, right)
+
+ def test_hash(self):
+ for (left, right) in self.__equal_pairs:
+ self.assertEqual(hash(left), hash(right))
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « tools/lexer_generator/nfa.py ('k') | tools/lexer_generator/transition_keys.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698