Changeset View
Changeset View
Standalone View
Standalone View
src/parser/__tests__/PhutilTypeSpecTestCase.php
| Show All 12 Lines | $good = array( | ||||
| 'list < string >', | 'list < string >', | ||||
| 'int (must be even)', | 'int (must be even)', | ||||
| 'optional int', | 'optional int', | ||||
| 'int?', | 'int?', | ||||
| 'int|null?', | 'int|null?', | ||||
| 'optional int? (minimum 300)', | 'optional int? (minimum 300)', | ||||
| 'list<wild>', | 'list<wild>', | ||||
| 'list<list<list<map<string, string>>>> (easy)', | 'list<list<list<map<string, string>>>> (easy)', | ||||
| '\SomeClass', | |||||
| '\Namespace\SomeClass', | |||||
| '\NamespaceA\NamespaceB\NamespaceC', | |||||
| 'NamespaceA\NamespaceB\NamespaceC', | |||||
| ); | ); | ||||
| $bad = array( | $bad = array( | ||||
| '<list>', | '<list>', | ||||
| 'list<>', | 'list<>', | ||||
| 'list<string, string>', | 'list<string, string>', | ||||
| 'map|map', | 'map|map', | ||||
| 'int optional', | 'int optional', | ||||
| '(derp)', | '(derp)', | ||||
| 'list<string (capital letters), string>', | 'list<string (capital letters), string>', | ||||
| 'int?|string', | 'int?|string', | ||||
| '\\', | |||||
| '\\\\', | |||||
| '\SomeClass\\', | |||||
| 'SomeClass\\', | |||||
| ); | ); | ||||
| $good = array_fill_keys($good, true); | $good = array_fill_keys($good, true); | ||||
| $bad = array_fill_keys($bad, false); | $bad = array_fill_keys($bad, false); | ||||
| foreach ($good + $bad as $input => $expect) { | foreach ($good + $bad as $input => $expect) { | ||||
| $caught = null; | $caught = null; | ||||
| try { | try { | ||||
| ▲ Show 20 Lines • Show All 273 Lines • Show Last 20 Lines | |||||