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

Side by Side Diff: tools/foozzie/v8_foozzie_test.py

Issue 2578503003: [foozzie] Initial correctness fuzzer harness. (Closed)
Patch Set: Presubmit Created 4 years 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
« no previous file with comments | « tools/foozzie/v8_foozzie.py ('k') | tools/foozzie/v8_mock.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 the V8 project authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import unittest
6
7 import v8_suppressions
8
9 class FuzzerTest(unittest.TestCase):
10 def testDiff(self):
11 # TODO(machenbach): Mock out suppression configuration.
12 suppress = v8_suppressions.get_suppression(
13 'x64', 'fullcode', 'x64', 'default')
14 one = ''
15 two = ''
16 diff = None
17 self.assertEquals(diff, suppress.diff(one, two))
18
19 one = 'a \n b\nc();'
20 two = 'a \n b\nc();'
21 diff = None
22 self.assertEquals(diff, suppress.diff(one, two))
23
24 # Ignore line before caret, caret position, stack trace char numbers
25 # error message and validator output.
26 one = """
27 undefined
28 weird stuff
29 ^
30 Validation of asm.js module failed: foo bar
31 somefile.js: TypeError: undefined is not a function
32 stack line :15: foo
33 undefined
34 """
35 two = """
36 undefined
37 other weird stuff
38 ^
39 somefile.js: TypeError: baz is not a function
40 stack line :2: foo
41 Validation of asm.js module failed: baz
42 undefined
43 """
44 diff = None
45 self.assertEquals(diff, suppress.diff(one, two))
46
47 one = """
48 Still equal
49 Extra line
50 """
51 two = """
52 Still equal
53 """
54 diff = '- Extra line'
55 self.assertEquals(diff, suppress.diff(one, two))
56
57 one = """
58 Still equal
59 """
60 two = """
61 Still equal
62 Extra line
63 """
64 diff = '+ Extra line'
65 self.assertEquals(diff, suppress.diff(one, two))
66
67 one = """
68 undefined
69 somefile.js: TypeError: undefined is not a constructor
70 """
71 two = """
72 undefined
73 otherfile.js: TypeError: undefined is not a constructor
74 """
75 diff = """- somefile.js: TypeError: undefined is not a constructor
76 + otherfile.js: TypeError: undefined is not a constructor"""
77 self.assertEquals(diff, suppress.diff(one, two))
OLDNEW
« no previous file with comments | « tools/foozzie/v8_foozzie.py ('k') | tools/foozzie/v8_mock.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698