Skip to content
  • Katsunori FUJIWARA's avatar
    contrib: add an utility module to parse test scripts · 726cfc47f17a
    Katsunori FUJIWARA authored
    This patch centralizes the logic to pick up code fragments embedded in
    *.t script, in order to:
    
      - apply checking with patterns in check-code.py on such embedded
        code fragments
    
        Now, check-code.py completely ignores embedded code
        fragments. I'll post another patch series to check them.
    
      - replace similar code path in contrib/import-checker.py
    
        Current import-checker.py has problems below. Fixing each of them
        is a little difficult, because parsing logic and pattern strings
        are tightly coupled.
    
        - overlook (or mis-detect) the end of inline script in doctest
          style
    
          8a8dd6e4a97a fixed a part of this issue, but not enough.
    
        - it overlooks inline script in doctest style at the end of file
          (and ignores invalid un-closed heredoc at the end of file, too)
    
        - it overlooks code fragment in styles below
          - "python <<EOF" (heredoc should be "cat > file <<EOF" style)
          - "cat > foobar.py << ANYLIMIT" (...
    726cfc47f17a