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

Side by Side Diff: base/dafsa/make_dafsa_unittest.py

Issue 2784933002: Mitigate spoofing attempt using Latin letters. (Closed)
Patch Set: add similarity check unittests Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 6
7 import sys 7 import sys
8 import unittest 8 import unittest
9 import make_dafsa 9 import make_dafsa
10 10
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 infile = [ '%%', 'aa, 1', 'bbb, 2', 'baa, 1', '%%' ] 750 infile = [ '%%', 'aa, 1', 'bbb, 2', 'baa, 1', '%%' ]
751 bytes = [ 0x02, 0x83, 0xE2, 0x02, 0x83, 0x61, 0x61, 0x81, 0x62, 0x62, 751 bytes = [ 0x02, 0x83, 0xE2, 0x02, 0x83, 0x61, 0x61, 0x81, 0x62, 0x62,
752 0x82 ] 752 0x82 ]
753 outfile = make_dafsa.to_cxx(bytes) 753 outfile = make_dafsa.to_cxx(bytes)
754 self.assertEqual(make_dafsa.words_to_cxx(make_dafsa.parse_gperf(infile)), 754 self.assertEqual(make_dafsa.words_to_cxx(make_dafsa.parse_gperf(infile)),
755 outfile) 755 outfile)
756 756
757 757
758 if __name__ == '__main__': 758 if __name__ == '__main__':
759 unittest.main() 759 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698