tryParser( '', '', array(), pht('Empty')); $this->tryParser( '1', '1', array( 'mi' => 'color: #ff0000', ), pht('Simple')); $this->tryParser( '1', '1', array(), pht('Missing Class')); $this->tryParser( 'X', 'X', array( 'nc' => 'color: #ff0000', ), pht('Extra Attribute')); } private function tryParser($input, $expect, array $map, $label) { $actual = id(new PhutilPygmentizeParser()) ->setMap($map) ->parse($input); $this->assertEqual($expect, $actual, pht('Pygmentize Parser: %s', $label)); } }