|
| 1 | +script "CoreExecutionUQL" |
| 2 | +/* |
| 3 | +Copyright (C) 2018 LiveCode Ltd. |
| 4 | +
|
| 5 | +This file is part of LiveCode. |
| 6 | +
|
| 7 | +LiveCode is free software; you can redistribute it and/or modify it under |
| 8 | +the terms of the GNU General Public License v3 as published by the Free |
| 9 | +Software Foundation. |
| 10 | +
|
| 11 | +LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | +WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | +for more details. |
| 15 | +
|
| 16 | +You should have received a copy of the GNU General Public License |
| 17 | +along with LiveCode. If not see <http://www.gnu.org/licenses/>. */ |
| 18 | + |
| 19 | +on TestUQLPut |
| 20 | + put "foo" into tTest1 |
| 21 | + TestAssert "unquoted literal put into", tTest1 is "foo" |
| 22 | + put "foo" after tTest2 |
| 23 | + TestAssert "unquoted literal put after", tTest2 is "foo" |
| 24 | + put "foo" before tTest3 |
| 25 | + TestAssert "unquoted literal put before", tTest3 is "foo" |
| 26 | +end TestUQLPut |
| 27 | + |
| 28 | +on TestUQLValue |
| 29 | + TestAssert "unquoted literal value", tTest1 is "tTest1" |
| 30 | +end TestUQLValue |
| 31 | + |
| 32 | +on TestUQLMatchText |
| 33 | + put "rangeInt={0,3}" into tVar |
| 34 | + get matchText(tVar,"(.*?)={(.*?)}", tOption, tValue) |
| 35 | + TestAssert "matchText assigns correct values to UQL", \ |
| 36 | + tOption is "rangeInt" and tValue is "0,3" |
| 37 | +end TestUQLMatchText |
| 38 | + |
| 39 | +on TestUQLBinaryDecode |
| 40 | + get binaryDecode("h*",sha1Digest("foobar"), tFoobar) |
| 41 | + TestAssert "binaryDecode assigns correct values to UQL", \ |
| 42 | + tFoobar is "88347d9f426112d19ebe9b36ffc42e1852398287" |
| 43 | +end TestUQLBinaryDecode |
| 44 | + |
| 45 | +on TestUQLQueryRegistry |
| 46 | + TestSkipIfNot "platform", "win32" |
| 47 | + get queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir", tType) |
| 48 | + TestAssert "queryRegistry assigns correct values to UQL", \ |
| 49 | + tType is "string" |
| 50 | +end TestUQLQueryRegistry |
0 commit comments