-
Notifications
You must be signed in to change notification settings - Fork 3
/
tests.ahk
61 lines (48 loc) · 1.36 KB
/
tests.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
; Copyright (C) 2019, 2020, 2021 Christopher S. Galpin. Licensed under AGPL-3.0-or-later. See /NOTICE.
#SingleInstance, force
#Warn
return
HasUtf16Internals() {
str := "0.333333"
float := 1 / 3 ; stored identically to above
loop, % (StrLen(str) + 1) * 2 { ; include null-terminator, and 2 bytes each
; MsgBox % A_Index - 1 " str: " NumGet(str, A_Index - 1, "UChar") " float: " NumGet(float, A_Index - 1, "UChar")
if (NumGet(str, A_Index - 1, "UChar") != NumGet(float, A_Index - 1, "UChar"))
return False
}
return True
}
GetSmile() {
return "🙂"
}
ComMsGraphCall() {
comMsGraph := ComObjCreate("MSGraph.Application")
}
ComFsoTempName() {
comFso := ComObjCreate("Scripting.FileSystemObject")
return comFso.GetTempName()
}
UserException() {
throw Exception("UserException", "example what", "example extra")
}
NonException1() {
throw 12345
}
NonException2() {
throw "hello"
}
NonException3() {
throw {abc: 123, def: "hi"}
}
NonException4() {
throw {Message: "example message", What: "example what", File: "some file", Line: "not a number"}
}
ContrivedException() {
throw {Message: "ContrivedException", What: "example what", File: "some file", Line: 9999999999}
}
Echo(val) {
return val
}
Copy(val) {
Clipboard := val
}