diff options
Diffstat (limited to 'Lib/test/test_flufl.py')
-rw-r--r-- | Lib/test/test_flufl.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Lib/test/test_flufl.py b/Lib/test/test_flufl.py new file mode 100644 index 0000000..5a709bc --- /dev/null +++ b/Lib/test/test_flufl.py @@ -0,0 +1,27 @@ +import __future__ +import unittest + +class FLUFLTests(unittest.TestCase): + + def test_barry_as_bdfl(self): + code = "from __future__ import barry_as_FLUFL; 2 {0} 3" + compile(code.format('<>'), '<BDFL test>', 'exec', + __future__.CO_FUTURE_BARRY_AS_BDFL) + self.assertRaises(SyntaxError, compile, code.format('!='), + '<FLUFL test>', 'exec', + __future__.CO_FUTURE_BARRY_AS_BDFL) + + def test_guido_as_bdfl(self): + code = '2 {0} 3' + compile(code.format('!='), '<BDFL test>', 'exec') + self.assertRaises(SyntaxError, compile, code.format('<>'), + '<FLUFL test>', 'exec') + + +def test_main(): + from test.support import run_unittest + run_unittest(FLUFLTests) + + +if __name__ == '__main__': + test_main() |