Changeset View
Changeset View
Standalone View
Standalone View
autotests/src/variable_test.cpp
Show First 20 Lines • Show All 288 Lines • ▼ Show 20 Line(s) | 166 | { | |||
---|---|---|---|---|---|
289 | qputenv("KTE_ENV_VAR_TEST", "KTE_ENV_VAR_TEST_VALUE"); | 289 | qputenv("KTE_ENV_VAR_TEST", "KTE_ENV_VAR_TEST_VALUE"); | ||
290 | editor->expandText(QStringLiteral("%{ENV:KTE_ENV_VAR_TEST}"), view, out); | 290 | editor->expandText(QStringLiteral("%{ENV:KTE_ENV_VAR_TEST}"), view, out); | ||
291 | QCOMPARE(out, QStringLiteral("KTE_ENV_VAR_TEST_VALUE")); | 291 | QCOMPARE(out, QStringLiteral("KTE_ENV_VAR_TEST_VALUE")); | ||
292 | 292 | | |||
293 | // JS:<code> | 293 | // JS:<code> | ||
294 | editor->expandText(QStringLiteral("%{JS:3 + %{JS:2 + 1}}"), view, out); | 294 | editor->expandText(QStringLiteral("%{JS:3 + %{JS:2 + 1}}"), view, out); | ||
295 | QCOMPARE(out, QStringLiteral("6")); | 295 | QCOMPARE(out, QStringLiteral("6")); | ||
296 | 296 | | |||
297 | // PercentEncoded: since 5.67 | ||||
298 | editor->expandText(QStringLiteral("%{PercentEncoded:{a&b+c=d} \"}"), view, out); | ||||
299 | QCOMPARE(out, QStringLiteral("%7Ba%26b%2Bc%3Dd%7D%20%22")); | ||||
300 | | ||||
297 | // UUID | 301 | // UUID | ||
298 | editor->expandText(QStringLiteral("%{UUID}"), view, out); | 302 | editor->expandText(QStringLiteral("%{UUID}"), view, out); | ||
299 | QCOMPARE(out.count(QLatin1Char('-')), 4); | 303 | QCOMPARE(out.count(QLatin1Char('-')), 4); | ||
300 | } | 304 | } | ||
301 | 305 | | |||
302 | // kate: indent-mode cstyle; indent-width 4; replace-tabs on; | 306 | // kate: indent-mode cstyle; indent-width 4; replace-tabs on; |