Lines Matching full:before
43 before = '(a + b + c + d) / (2 * e)'
44 after = before
45 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
49 before = r'topdown\-fe\-bound / topdown\-slots - 1'
50 after = before
51 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
55 before = r'arb@event\=0x81\,umask\=0x1@ + arb@event\=0x84\,umask\=0x1@'
56 after = before
57 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
60 before = r'a + 1e12 + b'
61 after = before
62 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
66 before = r'Event1 if #smt_on else Event2'
67 after = f'({before})'
68 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
70 before = r'Event1 if 0 else Event2'
71 after = f'({before})'
72 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
74 before = r'Event1 if 1 else Event2'
75 after = f'({before})'
76 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
79 before = r'Event1 + 1 if Event2 < 2 else Event3 + 3'
82 self.assertEqual(ParsePerfJson(before).ToPython(), after)
84 before = r'Event1 > 1 if Event2 < 2 else Event3 > 3'
87 self.assertEqual(ParsePerfJson(before).ToPython(), after)
89 before = r'min(a + b if c > 1 else c + d, e + f)'
91 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
93 before = r'a if b else c if d else e'
95 self.assertEqual(ParsePerfJson(before).ToPerfJson(), after)
100 before = '(a + b + c + d) / (2 * e)'
101 py = ParsePerfJson(before).ToPython()
103 self.assertEqual(before, after)
106 before = '1 + 2 + 3'
108 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
110 before = 'a + 0'
112 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
114 before = '0 + a'
116 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
118 before = 'a | 0'
120 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
122 before = '0 | a'
124 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
126 before = 'a * 0'
128 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
130 before = '0 * a'
132 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
134 before = 'a * 1'
136 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
138 before = '1 * a'
140 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
142 before = 'a if 0 else b'
144 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
146 before = 'a if 1 else b'
148 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
150 before = 'a if b else a'
152 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
155 before = '0 * SLOTS'
157 self.assertEqual(ParsePerfJson(before).Simplify().ToPerfJson(), after)
161 before = [('cpu', 'm1', ParsePerfJson('a + b + c + d')),
164 self.assertEqual(RewriteMetricsInTermsOfOthers(before), after)