test_quoted_character.py 927 B

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