From 6a66fef520d0fb2b8d507c3e91e03338fc39a57e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 13 Mar 2012 17:15:27 +0100 Subject: add $$val_escape() function this quotes the elements of a variable in a way suitable for re-parsing as qmake code. Change-Id: I0e6ea2478c43b5aeff45f485a48ac8c86705dd4a Reviewed-by: Marius Storm-Olsen --- tests/auto/tools/qmake/testdata/functions/functions.pro | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/auto/tools/qmake/testdata') diff --git a/tests/auto/tools/qmake/testdata/functions/functions.pro b/tests/auto/tools/qmake/testdata/functions/functions.pro index 219e683e1f..7792859327 100644 --- a/tests/auto/tools/qmake/testdata/functions/functions.pro +++ b/tests/auto/tools/qmake/testdata/functions/functions.pro @@ -1,5 +1,9 @@ CONFIG = qt thread +defineTest(testReplace) { + !isEqual(1, $$2):message("FAILED: $$3: got $$1, expected $${2}.") +} + #count !count( CONFIG, 2 ) { message( "FAILED: count function: $$CONFIG" ) @@ -103,3 +107,8 @@ equals(moo, $$mooout)|message("FAILED: write_file() wrote something wrong when a pn = $$OUT_PWD/testpath/subdir mkpath($$pn)|message("FAILED: mkpath() failed") exists($$pn)|message("FAILED: mkpath() didn't create anything") + +in = easy "less easy" sca$${LITERAL_HASH}ry crazy$$escape_expand(\\t\\r\\n) $$escape_expand(\\t)shit \'no\"way\\here +out = "easy \"less easy\" sca\$\${LITERAL_HASH}ry crazy\$\$escape_expand(\\\\t\\\\r\\\\n) \$\$escape_expand(\\\\t)shit \\\'no\\\"way\\\\here" +testReplace($$val_escape(in), $$out, "val_escape") + -- cgit v1.2.3