glsl/tests: Handle windows \r\n new lines
authorDylan Baker <dylan@pnwbakers.com>
Fri, 31 May 2019 17:13:55 +0000 (10:13 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Tue, 10 Sep 2019 20:36:46 +0000 (20:36 +0000)
Currently the praser for s expressions assumes that newlines will be \n,
resulting in incorrect parsing on windows, where the newline is \r\n.
This patch just adds \r? to the regular expression used to parse the s
expressions, which fixes at 1 test on windows.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/compiler/glsl/tests/sexps.py

index 7939b42f9a2f1369ec990c39ac2e2a41fde628e7..7de5db39be6a7b06ad77ac40bdd00386ba28c7df 100644 (file)
@@ -52,7 +52,7 @@ def parse_sexp(sexp):
     into a sexp represented as nested lists containing strings.
     """
     sexp_token_regexp = re.compile(
-        '[a-zA-Z_]+(@[0-9]+)?|[0-9]+(\\.[0-9]+)?|[^ \n]')
+        '[a-zA-Z_]+(@[0-9]+)?|[0-9]+(\\.[0-9]+)?|[^ \r?\n]')
     stack = [[]]
     for match in sexp_token_regexp.finditer(sexp):
         token = match.group(0)