test_quoted_character.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. """See https://github.com/numpy/numpy/pull/10676.
  2. """
  3. from __future__ import division, absolute_import, print_function
  4. import sys
  5. from importlib import import_module
  6. import pytest
  7. from numpy.testing import assert_equal
  8. from . import util
  9. class TestQuotedCharacter(util.F2PyTest):
  10. code = """
  11. SUBROUTINE FOO(OUT1, OUT2, OUT3, OUT4, OUT5, OUT6)
  12. CHARACTER SINGLE, DOUBLE, SEMICOL, EXCLA, OPENPAR, CLOSEPAR
  13. PARAMETER (SINGLE="'", DOUBLE='"', SEMICOL=';', EXCLA="!",
  14. 1 OPENPAR="(", CLOSEPAR=")")
  15. CHARACTER OUT1, OUT2, OUT3, OUT4, OUT5, OUT6
  16. Cf2py intent(out) OUT1, OUT2, OUT3, OUT4, OUT5, OUT6
  17. OUT1 = SINGLE
  18. OUT2 = DOUBLE
  19. OUT3 = SEMICOL
  20. OUT4 = EXCLA
  21. OUT5 = OPENPAR
  22. OUT6 = CLOSEPAR
  23. RETURN
  24. END
  25. """
  26. @pytest.mark.skipif(sys.platform=='win32',
  27. reason='Fails with MinGW64 Gfortran (Issue #9673)')
  28. def test_quoted_character(self):
  29. assert_equal(self.module.foo(), (b"'", b'"', b';', b'!', b'(', b')'))