use Test::Simple tests => 7; sub cpi { # the converter goes here } $a = '>> no snake here >>> or here I agree'; $b = '>> and neither should this >>> be understood snakily >>> because it is a nested quote >> yes I know it is not really named after a snake '; $c = '>> >>>no snake >>>no snake '; $d= '>>> still no snake seen >> right! '; $snakea = '>>> i = j '; $snakeb = '>>> i = j + 1 >>> q is good code'; $snakec = '>> does this work right? lets see: >>> i = test(func) '; ok (cpi($a) eq $a); ok (cpi($b) eq $b); ok (cpi($c) eq $c); ok (cpi($d) eq $d); ok (cpi($snakea) eq 'PYTHON_PROMPT_PROTECTED i = j '); ok (cpi($snakeb) eq 'PYTHON_PROMPT_PROTECTED i = j + 1 PYTHON_PROMPT_PROTECTED q is good code'); ok(cpi($snakec) eq '>> does this work right? lets see: PYTHON_PROMPT_PROTECTED i = test(func) ');
In reply to Re^3: Using a regex to catch interpreters
by eastcoastcoder
in thread Using a regex to catch interpreters
by eastcoastcoder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |