Changeset View
Changeset View
Standalone View
Standalone View
autotests/html/test.ts.html
Show All 36 Lines | |||||
37 | <span style="color:#ff5500;">import</span> { isBuffer, isString, isObject } <span style="color:#ff5500;">from</span> <span style="color:#bf0303;">"util"</span>; | 37 | <span style="color:#ff5500;">import</span> { isBuffer, isString, isObject } <span style="color:#ff5500;">from</span> <span style="color:#bf0303;">"util"</span>; | ||
38 | 38 | | |||
39 | <span style="font-weight:bold;">const</span> port = <span style="color:#b08000;">8__88___8</span>; | 39 | <span style="font-weight:bold;">const</span> port = <span style="color:#b08000;">8__88___8</span>; | ||
40 | <span style="font-weight:bold;">const</span> baseUrl = <span style="font-weight:bold;">new</span> <span style="color:#644a9b;">URL</span>(<span style="color:#bf0303;">`http://localhost:</span><span style="color:#3daee9;">${</span>port<span style="color:#3daee9;">}</span><span style="color:#bf0303;">/`</span>); | 40 | <span style="font-weight:bold;">const</span> baseUrl = <span style="font-weight:bold;">new</span> <span style="color:#644a9b;">URL</span>(<span style="color:#bf0303;">`http://localhost:</span><span style="color:#3daee9;">${</span>port<span style="color:#3daee9;">}</span><span style="color:#bf0303;">/`</span>); | ||
41 | <span style="font-weight:bold;">const</span> rootDir = <span style="color:#0057ae;">path</span>.<span style="color:#644a9b;">dirname</span>(__dirname); | 41 | <span style="font-weight:bold;">const</span> rootDir = <span style="color:#0057ae;">path</span>.<span style="color:#644a9b;">dirname</span>(__dirname); | ||
42 | 42 | | |||
43 | <span style="font-weight:bold;">const</span> defaultBrowser = <span style="color:#0057ae;">os</span>.<span style="color:#644a9b;">platform</span>() === <span style="color:#bf0303;">"win32"</span> ? <span style="color:#bf0303;">"edge"</span> : <span style="color:#bf0303;">"chrome"</span>; | 43 | <span style="font-weight:bold;">const</span> defaultBrowser = <span style="color:#0057ae;">os</span>.<span style="color:#644a9b;">platform</span>() === <span style="color:#bf0303;">"win32"</span> ? <span style="color:#bf0303;">"edge"</span> : <span style="color:#bf0303;">"chrome"</span>; | ||
44 | <span style="font-weight:bold;font-style:italic;">let</span> browser: <span style="color:#bf0303;">"edge"</span> | <span style="color:#bf0303;">"chrome"</span> | <span style="color:#bf0303;">"none"</span> = defaultBrowser; | 44 | <span style="font-weight:bold;font-style:italic;">let</span> browser: <span style="color:#bf0303;">"edge"</span> | <span style="color:#bf0303;">"chrome"</span> | <span style="color:#bf0303;">"none"</span> = defaultBrowser; | ||
45 | <span style="font-weight:bold;font-style:italic;">let</span> grep: <span style="color:#0057ae;">string</span> | <span style="font-weight:bold;">undefined</span>; | 45 | <span style="font-weight:bold;font-style:italic;">let</span> grep: <span style="color:#0057ae;">string</span> | <span style="color:#0057ae;">undefined</span>; | ||
46 | 46 | | |||
47 | <span style="font-weight:bold;font-style:italic;">interface</span> FileBasedTestConfiguration { | 47 | <span style="font-weight:bold;font-style:italic;">interface</span> FileBasedTestConfiguration { | ||
48 | [setting: <span style="color:#0057ae;">string</span>]: <span style="color:#0057ae;">string</span>; | 48 | [setting: <span style="color:#0057ae;">string</span>]: <span style="color:#0057ae;">string</span>; | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | <span style="font-weight:bold;">function</span> <span style="color:#644a9b;">swapCase</span>(s: <span style="color:#0057ae;">string</span>): <span style="color:#0057ae;">string</span> { | 51 | <span style="font-weight:bold;">function</span> <span style="color:#644a9b;">swapCase</span>(s: <span style="color:#0057ae;">string</span>): <span style="color:#0057ae;">string</span> { | ||
52 | <span style="font-weight:bold;">return</span> <span style="color:#0057ae;">s</span>.<span style="color:#644a9b;">replace</span>(<span style="color:#ff5500;">/</span><span style="color:#3daee9;">\w</span><span style="color:#ff5500;">/g</span>, (ch) <span style="font-weight:bold;">=></span> { | 52 | <span style="font-weight:bold;">return</span> <span style="color:#0057ae;">s</span>.<span style="color:#644a9b;">replace</span>(<span style="color:#ff5500;">/</span><span style="color:#3daee9;">\w</span><span style="color:#ff5500;">/g</span>, (ch) <span style="font-weight:bold;">=></span> { | ||
53 | <span style="font-weight:bold;">const</span> up = <span style="color:#0057ae;">ch</span>.<span style="color:#644a9b;">toUpperCase</span>(); | 53 | <span style="font-weight:bold;">const</span> up = <span style="color:#0057ae;">ch</span>.<span style="color:#644a9b;">toUpperCase</span>(); | ||
54 | <span style="font-weight:bold;">return</span> ch === up ? <span style="color:#0057ae;">ch</span>.<span style="color:#644a9b;">toLowerCase</span>() : up; | 54 | <span style="font-weight:bold;">return</span> ch === up ? <span style="color:#0057ae;">ch</span>.<span style="color:#644a9b;">toLowerCase</span>() : up; | ||
55 | }); | 55 | }); | ||
56 | } | 56 | } | ||
57 | | ||||
58 | <span style="font-weight:bold;">for</span> (<span style="font-weight:bold;">var</span> i <span style="font-weight:bold;">in</span> pieces) { | ||||
59 | <span style="font-weight:bold;">switch</span> (<span style="font-weight:bold;">true</span>) { | ||||
60 | <span style="font-weight:bold;">case</span> <span style="color:#ff5500;">/</span><span style="color:#3daee9;">^\"?</span><span style="color:#ff5500;">Accession</span><span style="color:#3daee9;">\"?</span><span style="color:#ff5500;">/</span>.<span style="color:#644a9b;">test</span>(pieces[i]): | ||||
61 | numeration[<span style="color:#b08000;">0</span>] = i; | ||||
62 | <span style="font-weight:bold;">break</span>; | ||||
63 | } | ||||
64 | } | ||||
65 | | ||||
66 | <span style="color:#898887;">// Numerics</span> | ||||
67 | <span style="font-weight:bold;">var</span> a = <span style="color:#b08000;">0xA</span>; | ||||
68 | <span style="font-weight:bold;">var</span> b = <span style="color:#b08000;">0b1</span>; | ||||
69 | <span style="font-weight:bold;">var</span> c = <span style="color:#b08000;">0o7</span>; | ||||
70 | <span style="font-weight:bold;">var</span> d = <span style="color:#b08000;">1.1E+3</span>; | ||||
71 | <span style="font-weight:bold;">var</span> e = <span style="color:#b08000;">1.E+3</span>; | ||||
72 | <span style="font-weight:bold;">var</span> f = <span style="color:#b08000;">.1E+3</span>; | ||||
73 | <span style="font-weight:bold;">var</span> g = <span style="color:#b08000;">1E+3</span>; | ||||
74 | <span style="font-weight:bold;">var</span> h = <span style="color:#b08000;">1.1</span>; | ||||
75 | <span style="font-weight:bold;">var</span> i = <span style="color:#b08000;">1.</span>; | ||||
76 | <span style="font-weight:bold;">var</span> j = <span style="color:#b08000;">.1</span>; | ||||
77 | <span style="font-weight:bold;">var</span> k = <span style="color:#b08000;">1</span>; | ||||
78 | <span style="font-weight:bold;">var</span> l = <span style="color:#b08000;">1__.e+3_22</span> | <span style="color:#b08000;">.2____e2</span> | <span style="color:#b08000;">0o1_23</span> | <span style="color:#b08000;">11__.</span> ; | ||||
79 | | ||||
80 | <span style="color:#898887;">// Types</span> | ||||
81 | <span style="font-weight:bold;font-style:italic;">let</span> a: <span style="color:#0057ae;">null</span> = <span style="font-weight:bold;">null</span>; | ||||
82 | <span style="font-weight:bold;font-style:italic;">let</span> b: <span style="color:#0057ae;">number</span> = <span style="color:#b08000;">123</span>; | ||||
83 | <span style="font-weight:bold;font-style:italic;">let</span> c: <span style="color:#0057ae;">number</span> = <span style="color:#b08000;">123.456</span>; | ||||
84 | <span style="font-weight:bold;font-style:italic;">let</span> d: <span style="color:#0057ae;">string</span> = <span style="color:#bf0303;">`Geeks`</span>; | ||||
85 | <span style="font-weight:bold;font-style:italic;">let</span> e: <span style="color:#0057ae;">undefined</span> = <span style="font-weight:bold;">undefined</span>; | ||||
86 | <span style="font-weight:bold;font-style:italic;">let</span> f: <span style="color:#0057ae;">boolean</span> = <span style="font-weight:bold;">true</span>; | ||||
87 | <span style="font-weight:bold;font-style:italic;">let</span> g: <span style="color:#0057ae;">number</span> = <span style="color:#b08000;">0b111001</span>; <span style="color:#898887;">// Binary</span> | ||||
88 | <span style="font-weight:bold;font-style:italic;">let</span> h: <span style="color:#0057ae;">number</span> = <span style="color:#b08000;">0o436</span>; <span style="color:#898887;">// Octal</span> | ||||
89 | <span style="font-weight:bold;font-style:italic;">let</span> i: <span style="color:#0057ae;">number</span> = <span style="color:#b08000;">0xadf0d</span>; <span style="color:#898887;">// Hexa-Decimal </span> | ||||
90 | | ||||
91 | <span style="font-weight:bold;">const</span> query = <span style="color:#644a9b;">query</span><[<span style="color:#0057ae;">number</span>], <span style="color:#0057ae;">number</span>>(<span style="color:#bf0303;">`</span> | ||||
92 | <span style="color:#bf0303;"> SELECT *</span> | ||||
93 | <span style="color:#bf0303;"> FROM statistics</span> | ||||
94 | <span style="color:#bf0303;"> WHERE unit_id = $1`</span>) | ||||
95 | | ||||
96 | <span style="font-weight:bold;">function</span> <span style="color:#644a9b;">runQuery</span>() { | ||||
97 | <span style="font-weight:bold;">const</span> query = <span style="color:#644a9b;">createQuery</span><[<span style="color:#0057ae;">number</span>[]], Table<Columns>>(<span style="color:#bf0303;">`</span> | ||||
98 | <span style="color:#bf0303;"> some SQL here</span> | ||||
99 | <span style="color:#bf0303;"> `</span>) | ||||
100 | <span style="font-weight:bold;">return</span> <span style="color:#0057ae;">database</span>.<span style="color:#644a9b;">execute</span>(query) | ||||
101 | } | ||||
102 | | ||||
103 | aa: <sdf/> <span style="color:#0057ae;">string</span> ?<ssd/> <span style="color:#0057ae;">string</span> | ||||
104 | string <span style="color:#898887;">// Don't highlight</span> | ||||
105 | aa: <span style="color:#0057ae;">string</span> assa | | ||||
106 | <span style="color:#0057ae;">string</span> | ||||
107 | <span style="color:#0057ae;">string</span> ; | ||||
108 | string | ||||
109 | | ||||
110 | aa: { <span style="color:#0057ae;">string</span> | ||||
111 | string } <span style="color:#898887;">// Don't highlight</span> | ||||
112 | | ||||
113 | aa: [ <span style="color:#0057ae;">string</span> | ||||
114 | <span style="color:#0057ae;">string</span> ] | ||||
115 | aa: ( <span style="color:#0057ae;">string</span> | ||||
116 | string ) <span style="color:#898887;">// Don't highlight</span> | ||||
117 | aa: <span style="color:#0057ae;">string</span> <<span style="color:#0057ae;">string</span>> | ||||
57 | </pre></body></html> | 118 | </pre></body></html> |