| /third_party/node/doc/api/ |
| H A D | child_process.html | 62 <li><a href="path.html" class="nav-path">Path</a></li> 102 <path fill="none" d="M0 0h24v24H0z" /> 103 <path d="M11.1 12.08c-2.33-4.51-.5-8.48.53-10.07C6.27 2.2 1.98 6.59 1.98 12c0 .14.02.28.02.42.62-.27 1.29-.42 2-.42 1.66 0 3.18.83 4.1 2.15A4.01 4.01 0 0111 18c0 1.52-.87 2.83-2.12 3.51.98.32 2.03.5 3.11.5 3.5 0 6.58-1.8 8.37-4.52-2.36.23-6.98-.97-9.26-5.41z"/> 104 <path d="M7 16h-.18C6.4 14.84 5.3 14 4 14c-1.66 0-3 1.34-3 3s1.34 3 3 3h3c1.1 0 2-.9 2-2s-.9-2-2-2z"/> 107 <path d="M0 0h24v24H0z" fill="none" /> 108 <path d="M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"/> 244 <li><a href="path.html" class="nav-path">Pat [all...] |
| H A D | http.json | 23 "desc": "<p>An <code>Agent</code> is responsible for managing connection persistence\nand reuse for HTTP clients. It maintains a queue of pending requests\nfor a given host and port, reusing a single socket connection for each\nuntil the queue is empty, at which time the socket is either destroyed\nor put into a pool where it is kept to be used again for requests to the\nsame host and port. Whether it is destroyed or pooled depends on the\n<code>keepAlive</code> <a href=\"#new-agentoptions\">option</a>.</p>\n<p>Pooled connections have TCP Keep-Alive enabled for them, but servers may\nstill close idle connections, in which case they will be removed from the\npool and a new connection will be made when a new HTTP request is made for\nthat host and port. Servers may also refuse to allow multiple requests\nover the same connection, in which case the connection will have to be\nremade for every request and cannot be pooled. The <code>Agent</code> will still make\nthe requests to that server, but each one will occur over a new connection.</p>\n<p>When a connection is closed by the client or the server, it is removed\nfrom the pool. Any unused sockets in the pool will be unrefed so as not\nto keep the Node.js process running when there are no outstanding requests.\n(see <a href=\"net.html#socketunref\"><code>socket.unref()</code></a>).</p>\n<p>It is good practice, to <a href=\"#agentdestroy\"><code>destroy()</code></a> an <code>Agent</code> instance when it is no\nlonger in use, because unused sockets consume OS resources.</p>\n<p>Sockets are removed from an agent when the socket emits either\na <code>'close'</code> event or an <code>'agentRemove'</code> event. When intending to keep one\nHTTP request open for a long time without keeping it in the agent, something\nlike the following may be done:</p>\n<pre><code class=\"language-js\">http.get(options, (res) => {\n // Do stuff\n}).on('socket', (socket) => {\n socket.emit('agentRemove');\n});\n</code></pre>\n<p>An agent may also be used for an individual request. By providing\n<code>{agent: false}</code> as an option to the <code>http.get()</code> or <code>http.request()</code>\nfunctions, a one-time use <code>Agent</code> with default options will be used\nfor the client connection.</p>\n<p><code>agent:false</code>:</p>\n<pre><code class=\"language-js\">http.get({\n hostname: 'localhost',\n port: 80,\n path: '/',\n agent: false, // Create a new agent just for this one request\n}, (res) => {\n // Do stuff with response\n});\n</code></pre>", 418 "desc": "<p>Emitted each time a server responds to a request with a <code>CONNECT</code> method. If\nthis event is not being listened for, clients receiving a <code>CONNECT</code> method will\nhave their connections closed.</p>\n<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#class-netsocket\" class=\"type\"><net.Socket></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\" class=\"type\"><stream.Duplex></a>, unless the user specifies a socket\ntype other than <a href=\"net.html#class-netsocket\" class=\"type\"><net.Socket></a>.</p>\n<p>A client and server pair demonstrating how to listen for the <code>'connect'</code> event:</p>\n<pre><code class=\"language-mjs\">import { createServer, request } from 'node:http';\nimport { connect } from 'node:net';\nimport { URL } from 'node:url';\n\n// Create an HTTP tunneling proxy\nconst proxy = createServer((req, res) => {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.end('okay');\n});\nproxy.on('connect', (req, clientSocket, head) => {\n // Connect to an origin server\n const { port, hostname } = new URL(`http://${req.url}`);\n const serverSocket = connect(port || 80, hostname, () => {\n clientSocket.write('HTTP/1.1 200 Connection Established\\r\\n' +\n 'Proxy-agent: Node.js-Proxy\\r\\n' +\n '\\r\\n');\n serverSocket.write(head);\n serverSocket.pipe(clientSocket);\n clientSocket.pipe(serverSocket);\n });\n});\n\n// Now that proxy is running\nproxy.listen(1337, '127.0.0.1', () => {\n\n // Make a request to a tunneling proxy\n const options = {\n port: 1337,\n host: '127.0.0.1',\n method: 'CONNECT',\n path: 'www.google.com:80',\n };\n\n const req = request(options);\n req.end();\n\n req.on('connect', (res, socket, head) => {\n console.log('got connected!');\n\n // Make a request over an HTTP tunnel\n socket.write('GET / HTTP/1.1\\r\\n' +\n 'Host: www.google.com:80\\r\\n' +\n 'Connection: close\\r\\n' +\n '\\r\\n');\n socket.on('data', (chunk) => {\n console.log(chunk.toString());\n });\n socket.on('end', () => {\n proxy.close();\n });\n });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst net = require('node:net');\nconst { URL } = require('node:url');\n\n// Create an HTTP tunneling proxy\nconst proxy = http.createServer((req, res) => {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.end('okay');\n});\nproxy.on('connect', (req, clientSocket, head) => {\n // Connect to an origin server\n const { port, hostname } = new URL(`http://${req.url}`);\n const serverSocket = net.connect(port || 80, hostname, () => {\n clientSocket.write('HTTP/1.1 200 Connection Established\\r\\n' +\n 'Proxy-agent: Node.js-Proxy\\r\\n' +\n '\\r\\n');\n serverSocket.write(head);\n serverSocket.pipe(clientSocket);\n clientSocket.pipe(serverSocket);\n });\n});\n\n// Now that proxy is running\nproxy.listen(1337, '127.0.0.1', () => {\n\n // Make a request to a tunneling proxy\n const options = {\n port: 1337,\n host: '127.0.0.1',\n method: 'CONNECT',\n path: 'www.google.com:80',\n };\n\n const req = http.request(options);\n req.end();\n\n req.on('connect', (res, socket, head) => {\n console.log('got connected!');\n\n // Make a request over an HTTP tunnel\n socket.write('GET / HTTP/1.1\\r\\n' +\n 'Host: www.google.com:80\\r\\n' +\n 'Connection: close\\r\\n' +\n '\\r\\n');\n socket.on('data', (chunk) => {\n console.log(chunk.toString());\n });\n socket.on('end', () => {\n proxy.close();\n });\n });\n});\n</code></pre>" 500 "desc": "<p>Emitted when the server sends a 1xx intermediate response (excluding 101\nUpgrade). The listeners of this event will receive an object containing the\nHTTP version, status code, status message, key-value headers object,\nand array with the raw header names followed by their respective values.</p>\n<pre><code class=\"language-mjs\">import { request } from 'node:http';\n\nconst options = {\n host: '127.0.0.1',\n port: 8080,\n path: '/length_request',\n};\n\n// Make a request\nconst req = request(options);\nreq.end();\n\nreq.on('information', (info) => {\n console.log(`Got information prior to main response: ${info.statusCode}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\nconst options = {\n host: '127.0.0.1',\n port: 8080,\n path: '/length_request',\n};\n\n// Make a request\nconst req = http.request(options);\nreq.end();\n\nreq.on('information', (info) => {\n console.log(`Got information prior to main response: ${info.statusCode}`);\n});\n</code></pre>\n<p>101 Upgrade statuses do not fire this event due to their break from the\ntraditional HTTP request/response chain, such as web sockets, in-place TLS\nupgrades, or HTTP 2.0. To be notified of 101 Upgrade notices, listen for the\n<a href=\"#event-upgrade\"><code>'upgrade'</code></a> event instead.</p>" 1138 "textRaw": "`path` {string} The request path.", 1140 "name": "path", 1147 "desc": "The request path." 3878 "textRaw": "`path` {strin [all...] |
| H A D | http2.json | 60 "desc": "<p>The following illustrates an HTTP/2 client:</p>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\nconst fs = require('node:fs');\nconst client = http2.connect('https://localhost:8443', {\n ca: fs.readFileSync('localhost-cert.pem'),\n});\nclient.on('error', (err) => console.error(err));\n\nconst req = client.request({ ':path': '/' });\n\nreq.on('response', (headers, flags) => {\n for (const name in headers) {\n console.log(`${name}: ${headers[name]}`);\n }\n});\n\nreq.setEncoding('utf8');\nlet data = '';\nreq.on('data', (chunk) => { data += chunk; });\nreq.on('end', () => {\n console.log(`\\n${data}`);\n client.close();\n});\nreq.end();\n</code></pre>", 67 "desc": "<p>Headers are represented as own-properties on JavaScript objects. The property\nkeys will be serialized to lower-case. Property values should be strings (if\nthey are not they will be coerced to strings) or an <code>Array</code> of strings (in order\nto send more than one value per header field).</p>\n<pre><code class=\"language-js\">const headers = {\n ':status': '200',\n 'content-type': 'text-plain',\n 'ABC': ['has', 'more', 'than', 'one', 'value'],\n};\n\nstream.respond(headers);\n</code></pre>\n<p>Header objects passed to callback functions will have a <code>null</code> prototype. This\nmeans that normal JavaScript object methods such as\n<code>Object.prototype.toString()</code> and <code>Object.prototype.hasOwnProperty()</code> will\nnot work.</p>\n<p>For incoming headers:</p>\n<ul>\n<li>The <code>:status</code> header is converted to <code>number</code>.</li>\n<li>Duplicates of <code>:status</code>, <code>:method</code>, <code>:authority</code>, <code>:scheme</code>, <code>:path</code>,\n<code>:protocol</code>, <code>age</code>, <code>authorization</code>, <code>access-control-allow-credentials</code>,\n<code>access-control-max-age</code>, <code>access-control-request-method</code>, <code>content-encoding</code>,\n<code>content-language</code>, <code>content-length</code>, <code>content-location</code>, <code>content-md5</code>,\n<code>content-range</code>, <code>content-type</code>, <code>date</code>, <code>dnt</code>, <code>etag</code>, <code>expires</code>, <code>from</code>,\n<code>host</code>, <code>if-match</code>, <code>if-modified-since</code>, <code>if-none-match</code>, <code>if-range</code>,\n<code>if-unmodified-since</code>, <code>last-modified</code>, <code>location</code>, <code>max-forwards</code>,\n<code>proxy-authorization</code>, <code>range</code>, <code>referer</code>,<code>retry-after</code>, <code>tk</code>,\n<code>upgrade-insecure-requests</code>, <code>user-agent</code> or <code>x-content-type-options</code> are\ndiscarded.</li>\n<li><code>set-cookie</code> is always an array. Duplicates are added to the array.</li>\n<li>For duplicate <code>cookie</code> headers, the values are joined together with '; '.</li>\n<li>For all other headers, the values are joined together with ', '.</li>\n</ul>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream, headers) => {\n console.log(headers[':path']);\n console.log(headers.ABC);\n});\n</code></pre>", 121 "desc": "<p>To receive pushed streams on the client, set a listener for the <code>'stream'</code>\nevent on the <code>ClientHttp2Session</code>:</p>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\n\nconst client = http2.connect('http://localhost');\n\nclient.on('stream', (pushedStream, requestHeaders) => {\n pushedStream.on('push', (responseHeaders) => {\n // Process response headers\n });\n pushedStream.on('data', (chunk) => { /* handle pushed data */ });\n});\n\nconst req = client.request({ ':path': '/' });\n</code></pre>", 128 "desc": "<p>The <code>CONNECT</code> method is used to allow an HTTP/2 server to be used as a proxy\nfor TCP/IP connections.</p>\n<p>A simple TCP Server:</p>\n<pre><code class=\"language-js\">const net = require('node:net');\n\nconst server = net.createServer((socket) => {\n let name = '';\n socket.setEncoding('utf8');\n socket.on('data', (chunk) => name += chunk);\n socket.on('end', () => socket.end(`hello ${name}`));\n});\n\nserver.listen(8000);\n</code></pre>\n<p>An HTTP/2 CONNECT proxy:</p>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\nconst { NGHTTP2_REFUSED_STREAM } = http2.constants;\nconst net = require('node:net');\n\nconst proxy = http2.createServer();\nproxy.on('stream', (stream, headers) => {\n if (headers[':method'] !== 'CONNECT') {\n // Only accept CONNECT requests\n stream.close(NGHTTP2_REFUSED_STREAM);\n return;\n }\n const auth = new URL(`tcp://${headers[':authority']}`);\n // It's a very good idea to verify that hostname and port are\n // things this proxy should be connecting to.\n const socket = net.connect(auth.port, auth.hostname, () => {\n stream.respond();\n socket.pipe(stream);\n stream.pipe(socket);\n });\n socket.on('error', (error) => {\n stream.close(http2.constants.NGHTTP2_CONNECT_ERROR);\n });\n});\n\nproxy.listen(8001);\n</code></pre>\n<p>An HTTP/2 CONNECT client:</p>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\n\nconst client = http2.connect('http://localhost:8001');\n\n// Must not specify the ':path' and ':scheme' headers\n// for CONNECT requests or an error will be thrown.\nconst req = client.request({\n ':method': 'CONNECT',\n ':authority': 'localhost:8000',\n});\n\nreq.on('response', (headers) => {\n console.log(headers[http2.constants.HTTP2_HEADER_STATUS]);\n});\nlet data = '';\nreq.setEncoding('utf8');\nreq.on('data', (chunk) => data += chunk);\nreq.on('end', () => {\n console.log(`The server says: ${data}`);\n client.close();\n});\nreq.end('Jane');\n</code></pre>", 378 "desc": "<p>The <code>'stream'</code> event is emitted when a new <code>Http2Stream</code> is created.</p>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\nsession.on('stream', (stream, headers, flags) => {\n const method = headers[':method'];\n const path = headers[':path'];\n // ...\n stream.respond({\n ':status': 200,\n 'content-type': 'text/plain; charset=utf-8',\n });\n stream.write('hello ');\n stream.end('world');\n});\n</code></pre>\n<p>On the server side, user code will typically not listen for this event directly,\nand would instead register a handler for the <code>'stream'</code> event emitted by the\n<code>net.Server</code> or <code>tls.Server</code> instances returned by <code>http2.createServer()</code> and\n<code>http2.createSecureServer()</code>, respectively, as in the example below:</p>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\n\n// Create an unencrypted HTTP/2 server\nconst server = http2.createServer();\n\nserver.on('stream', (stream, headers) => {\n stream.respond({\n 'content-type': 'text/html; charset=utf-8',\n ':status': 200,\n });\n stream.on('error', (error) => console.error(error));\n stream.end('<h1>Hello World</h1>');\n});\n\nserver.listen(8000);\n</code></pre>\n<p>Even though HTTP/2 streams and network sockets are not in a 1:1 correspondence,\na network error will destroy each individual stream and must be handled on the\nstream level, as shown above.</p>" 1025 "desc": "<p>For HTTP/2 Client <code>Http2Session</code> instances only, the <code>http2session.request()</code>\ncreates and returns an <code>Http2Stream</code> instance that can be used to send an\nHTTP/2 request to the connected server.</p>\n<p>When a <code>ClientHttp2Session</code> is first created, the socket may not yet be\nconnected. if <code>clienthttp2session.request()</code> is called during this time, the\nactual request will be deferred until the socket is ready to go.\nIf the <code>session</code> is closed before the actual request be executed, an\n<code>ERR_HTTP2_GOAWAY_SESSION</code> is thrown.</p>\n<p>This method is only available if <code>http2session.type</code> is equal to\n<code>http2.constants.NGHTTP2_SESSION_CLIENT</code>.</p>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\nconst clientSession = http2.connect('https://localhost:1234');\nconst {\n HTTP2_HEADER_PATH,\n HTTP2_HEADER_STATUS,\n} = http2.constants;\n\nconst req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });\nreq.on('response', (headers) => {\n console.log(headers[HTTP2_HEADER_STATUS]);\n req.on('data', (chunk) => { /* .. */ });\n req.on('end', () => { /* .. */ });\n});\n</code></pre>\n<p>When the <code>options.waitForTrailers</code> option is set, the <code>'wantTrailers'</code> event\nis emitted immediately after queuing the last chunk of payload data to be sent.\nThe <code>http2stream.sendTrailers()</code> method can then be called to send trailing\nheaders to the peer.</p>\n<p>When <code>options.waitForTrailers</code> is set, the <code>Http2Stream</code> will not automatically\nclose when the final <code>DATA</code> frame is transmitted. User code must call either\n<code>http2stream.sendTrailers()</code> or <code>http2stream.close()</code> to close the\n<code>Http2Stream</code>.</p>\n<p>When <code>options.signal</code> is set with an <code>AbortSignal</code> and then <code>abort</code> on the\ncorresponding <code>AbortController</code> is called, the request will emit an <code>'error'</code>\nevent with an <code>AbortError</code> error.</p>\n<p>The <code>:method</code> and <code>:path</code> pseudo-headers are not specified within <code>headers</code>,\nthey respectively default to:</p>\n<ul>\n<li><code>:method</code> = <code>'GET'</code></li>\n<li><code>:path</code> = <code>/</code></li>\n</ul>" 1486 "desc": "<pre><code class=\"language-js\">const http2 = require('node:http2');\nconst client = http2.connect('http://example.org:8000');\nconst { NGHTTP2_CANCEL } = http2.constants;\nconst req = client.request({ ':path' [all...] |
| H A D | diagnostics_channel.html | 62 <li><a href="path.html" class="nav-path">Path</a></li> 102 <path fill="none" d="M0 0h24v24H0z" /> 103 <path d="M11.1 12.08c-2.33-4.51-.5-8.48.53-10.07C6.27 2.2 1.98 6.59 1.98 12c0 .14.02.28.02.42.62-.27 1.29-.42 2-.42 1.66 0 3.18.83 4.1 2.15A4.01 4.01 0 0111 18c0 1.52-.87 2.83-2.12 3.51.98.32 2.03.5 3.11.5 3.5 0 6.58-1.8 8.37-4.52-2.36.23-6.98-.97-9.26-5.41z"/> 104 <path d="M7 16h-.18C6.4 14.84 5.3 14 4 14c-1.66 0-3 1.34-3 3s1.34 3 3 3h3c1.1 0 2-.9 2-2s-.9-2-2-2z"/> 107 <path d="M0 0h24v24H0z" fill="none" /> 108 <path d="M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"/> 228 <li><a href="path.html" class="nav-path">Pat [all...] |
| H A D | tls.md | 461 * `'PATH_LENGTH_EXCEEDED'`: Path length constraint exceeded. 1630 * `path` {string} Creates Unix socket connection to path. If this option is 1635 If this option is specified, `path`, `host`, and `port` are ignored, 1755 ## `tls.connect(path[, options][, callback])` 1761 * `path` {string} Default value for `options.path`. 1766 Same as [`tls.connect()`][] except that `path` can be provided 1769 A path option, if specified, will take precedence over the path argumen [all...] |
| /third_party/musl/ldso/linux/ |
| H A D | dynlink.c | 239 /* asan path open */ 256 static bool get_app_path(char *path, size_t size) in get_app_path() argument 259 l = readlink("/proc/self/exe", path, size); in get_app_path() 264 path[l] = 0; in get_app_path() 265 LD_LOGD("get_app_path path:%{public}s.", path); in get_app_path() 1874 * futher path search. */ in path_open() 3184 } else if (!memcmp(opt, "library-path", 12)) { in __dls3() 4934 int open_uncompressed_library_in_zipfile(const char *path, struct zip_info *z_info, char *separator) in open_uncompressed_library_in_zipfile() argument 4940 /* Use "'!/' to split the path int in open_uncompressed_library_in_zipfile() [all...] |
| /third_party/backends/sanei/ |
| H A D | sanei_usb.c | 580 SANE_Status sanei_usb_testing_enable_replay(SANE_String_Const path, in sanei_usb_testing_enable_replay() argument 587 testing_xml_path = strdup(path); in sanei_usb_testing_enable_replay() 614 SANE_Status sanei_usb_testing_enable_record(SANE_String_Const path, SANE_String_Const be_name) in sanei_usb_testing_enable_record() argument 618 testing_xml_path = strdup(path); in sanei_usb_testing_enable_record() 680 // transactions, because set_configuration is called in sanei_usb_open outside test path. 856 // slow path. The fast path utilizes the knowledge that there will be no spaces in sanei_xml_get_hex_data() 857 // within bytes. When this assumption does not hold, we switch to the slow path. in sanei_xml_get_hex_data() 1420 SANE_Status sanei_usb_testing_enable_replay(SANE_String_Const path, in sanei_usb_testing_enable_replay() argument 1423 (void) path; in sanei_usb_testing_enable_replay() 1430 sanei_usb_testing_enable_record(SANE_String_Const path, SANE_String_Const be_name) sanei_usb_testing_enable_record() argument [all...] |
| /third_party/nghttp2/integration-tests/ |
| H A D | nghttpx_http2_test.go | 997 if !strings.HasPrefix(r.URL.Path, "/css/") { 1071 t.Fatal("execution path should not be here") 1094 t.Fatal("execution path should not be here") 2367 path: "/foo?bar", 2540 const pattern = `affinity=[0-9a-f]{8}; Path=/foo/bar` 2569 const pattern = `affinity=[0-9a-f]{8}; Path=/foo/bar; Secure` 2590 pair(":path", "/"), 3359 path: "/api/v1beta1/backendconfig", 3401 path: "/api/v1beta1/backendconfig?foo=bar", 3443 path [all...] |
| /third_party/rust/crates/libc/libc-test/ |
| H A D | build.rs | 8 use std::path::{Path, PathBuf}; 122 fn process_semver_file<W: Write, P: AsRef<Path>>(output: &mut W, path: &mut PathBuf, file: P) { in process_semver_file() 123 // NOTE: `path` is reused between calls, so always remove the file again. in process_semver_file() 124 path.push(file); in process_semver_file() 125 path.set_extension("txt"); in process_semver_file() 127 println!("cargo:rerun-if-changed={}", path.display()); in process_semver_file() 128 let input_file = match File::open(&*path) { in process_semver_file() 131 path in process_semver_file() [all...] |
| /third_party/typescript/tests/baselines/reference/ |
| H A D | duplicateLocalVariable1.types | 206 >(function () { var testRunner = new TestRunner(); // First 3 are for simple harness validation testRunner.addTest(new TestCase("Basic test", function () { return true; })); testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, "")); testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass")); testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); })); testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); })); // File detection tests testRunner.addTest(new TestCase("Check file exists", function () { return FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test.txt"); })); testRunner.addTest(new TestCase("Check file doesn't exist", function () { return !FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test2.txt"); })); // File pattern matching tests testRunner.addTest(new TestCase("Check text file match", function () { return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) })); testRunner.addTest(new TestCase("Check makefile match", function () { return FileManager.FileBuffer.isTextFile("C:\\some dir\\makefile"); })); testRunner.addTest(new TestCase("Check binary file doesn't match", function () { return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") && !FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll")); })); // Command-line parameter tests testRunner.addTest(new TestCase("Check App defaults", function () { var app = new App.App([]); return (app.fixLines === false && app.recurse === true && app.lineEndings === "CRLF" && app.matchPattern === undefined && app.rootDirectory === ".\\" && app.encodings[0] === "ascii" && app.encodings[1] === "utf8nobom"); })); testRunner.addTest(new TestCase("Check App params", function () { var app = new App.App(["-dir=C:\\test dir", "-lineEndings=LF", "-encodings=utf16be,ascii", "-recurse=false", "-fixlines"]); return (app.fixLines === true && app.lineEndings === "LF" && app.recurse === false && app.matchPattern === undefined && app.rootDirectory === "C:\\test dir" && app.encodings[0] === "utf16be" && app.encodings[1] === "ascii" && app.encodings.length === 2); })); // File BOM detection tests testRunner.addTest(new TestCase("Check encoding detection no BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\noBOM.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding detection UTF8 BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); return fb.bom === 'utf8' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding detection UTF16be BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16BE.txt"); return fb.bom === 'utf16be' && fb.encoding === 'utf16be'; })); testRunner.addTest(new TestCase("Check encoding detection UTF16le BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16LE.txt"); return fb.bom === 'utf16le' && fb.encoding === 'utf16le'; })); testRunner.addTest(new TestCase("Check encoding on 1 bytes file", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\1bytefile.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding on 0 bytes file", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\0bytefile.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); // UTF8 encoding tests testRunner.addTest(new TestCase("Check byte reader", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var chars = []; for (var i = 0; i < 11; i++) { chars.push(fb.readByte()); } return TestRunner.arrayCompare(chars, [0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]); })); testRunner.addTest(new TestCase("Check UTF8 decoding", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var chars = []; for (var i = 0; i < 6; i++) { chars.push(fb.readUtf8CodePoint()); } return TestRunner.arrayCompare(chars, [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]); })); testRunner.addTest(new TestCase("Check UTF8 encoding", function () { var fb = new FileManager.FileBuffer(20); fb.writeUtf8Bom(); var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; for (var i in chars) { fb.writeUtf8CodePoint(chars[i]); } fb.index = 0; var bytes = []; for (var i = 0; i < 14; i++) { bytes.push(fb.readByte()); } var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; return TestRunner.arrayCompare(bytes, expected); })); // Test reading and writing files testRunner.addTest(new TestCase("Check saving a file", function () { var filename = TestFileDir + "\\tmpUTF16LE.txt"; var fb = new FileManager.FileBuffer(14); fb.writeUtf16leBom(); var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; chars.forEach(function (val) { fb.writeUtf16CodePoint(val, false); }); fb.save(filename); var savedFile = new FileManager.FileBuffer(filename); if (savedFile.encoding !== 'utf16le') { throw Error("Incorrect encoding"); } var expectedBytes = [0xFF, 0xFE, 0x54, 0x00, 0xE8, 0x00, 0x23, 0x1D, 0x20, 0x20, 0x0D, 0x00, 0x0A, 0x00] savedFile.index = 0; expectedBytes.forEach(function (val) { var byteVal = savedFile.readByte(); if (byteVal !== val) { throw Error("Incorrect byte value"); } }); return true; })); testRunner.addTest(new TestCase("Check reading past buffer asserts", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var result = fb.readByte(200); return true; }, "read beyond buffer length")); testRunner.addTest(new TestCase("Check writing past buffer asserts", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); fb.writeByte(5, 200); return true; }, "write beyond buffer length")); // Non-BMP unicode char tests testRunner.addTest(new TestCase("Read non-BMP utf16 chars", function () { var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf16leNonBmp.txt"); if (savedFile.encoding !== 'utf16le') { throw Error("Incorrect encoding"); } var codePoints = []; for (var i = 0; i < 6; i++) { codePoints.push(savedFile.readUtf16CodePoint(false)); } var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; return TestRunner.arrayCompare(codePoints, expectedCodePoints); })); testRunner.addTest(new TestCase("Read non-BMP utf8 chars", function () { var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf8NonBmp.txt"); if (savedFile.encoding !== 'utf8') { throw Error("Incorrect encoding"); } var codePoints = []; for (var i = 0; i < 6; i++) { codePoints.push(savedFile.readUtf8CodePoint()); } var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; return TestRunner.arrayCompare(codePoints, expectedCodePoints); })); testRunner.addTest(new TestCase("Write non-BMP utf8 chars", function () { var filename = TestFileDir + "\\tmpUTF8nonBmp.txt"; var fb = new FileManager.FileBuffer(15); var chars = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; chars.forEach(function (val) { fb.writeUtf8CodePoint(val); }); fb.save(filename); var savedFile = new FileManager.FileBuffer(filename); if (savedFile.encoding !== 'utf8') { throw Error("Incorrect encoding"); } var expectedBytes = [0xF0, 0x90, 0x92, 0x80, 0xF0, 0x90, 0x92, 0x81, 0xF0, 0x90, 0x92, 0x82, 0x54, 0x68, 0x69]; expectedBytes.forEach(function (val) { var byteVal = savedFile.readByte(); if (byteVal !== val) { throw Error("Incorrect byte value"); } }); return true; })); testRunner.addTest(new TestCase("Test invalid lead UTF8 byte", function () { var filename = TestFileDir + "\\utf8BadLeadByte.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Invalid UTF8 byte sequence at index: 4")); testRunner.addTest(new TestCase("Test invalid tail UTF8 byte", function () { var filename = TestFileDir + "\\utf8InvalidTail.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trailing byte invalid at index: 8")); testRunner.addTest(new TestCase("Test ANSI fails validation", function () { var filename = TestFileDir + "\\ansi.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trailing byte invalid at index: 6")); testRunner.addTest(new TestCase("Test UTF-16LE with invalid surrogate trail fails", function () { var filename = TestFileDir + "\\utf16leInvalidSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trail surrogate has an invalid value")); testRunner.addTest(new TestCase("Test UTF-16BE with invalid surrogate head fails", function () { var filename = TestFileDir + "\\UTF16BEInvalidSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Byte sequence starts with a trail surrogate")); testRunner.addTest(new TestCase("Test UTF-16LE with missing trail surrogate fails", function () { var filename = TestFileDir + "\\utf16leMissingTrailSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trail surrogate has an invalid value")); // Count of CRs & LFs testRunner.addTest(new TestCase("Count character occurrences", function () { var filename = TestFileDir + "\\charCountASCII.txt"; var fb = new FileManager.FileBuffer(filename); var result = (fb.countCR === 5 && fb.countLF === 4 && fb.countCRLF === 5 && fb.countHT === 3); return result; })); // Control characters in text testRunner.addTest(new TestCase("Test file with control character", function () { var filename = TestFileDir + "\\controlChar.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Codepoint at index: 3 has control value: 8")); return testRunner;})() : TestRunner
207 >(function () { var testRunner = new TestRunner(); // First 3 are for simple harness validation testRunner.addTest(new TestCase("Basic test", function () { return true; })); testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, "")); testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass")); testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); })); testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); })); // File detection tests testRunner.addTest(new TestCase("Check file exists", function () { return FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test.txt"); })); testRunner.addTest(new TestCase("Check file doesn't exist", function () { return !FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test2.txt"); })); // File pattern matching tests testRunner.addTest(new TestCase("Check text file match", function () { return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) })); testRunner.addTest(new TestCase("Check makefile match", function () { return FileManager.FileBuffer.isTextFile("C:\\some dir\\makefile"); })); testRunner.addTest(new TestCase("Check binary file doesn't match", function () { return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") && !FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll")); })); // Command-line parameter tests testRunner.addTest(new TestCase("Check App defaults", function () { var app = new App.App([]); return (app.fixLines === false && app.recurse === true && app.lineEndings === "CRLF" && app.matchPattern === undefined && app.rootDirectory === ".\\" && app.encodings[0] === "ascii" && app.encodings[1] === "utf8nobom"); })); testRunner.addTest(new TestCase("Check App params", function () { var app = new App.App(["-dir=C:\\test dir", "-lineEndings=LF", "-encodings=utf16be,ascii", "-recurse=false", "-fixlines"]); return (app.fixLines === true && app.lineEndings === "LF" && app.recurse === false && app.matchPattern === undefined && app.rootDirectory === "C:\\test dir" && app.encodings[0] === "utf16be" && app.encodings[1] === "ascii" && app.encodings.length === 2); })); // File BOM detection tests testRunner.addTest(new TestCase("Check encoding detection no BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\noBOM.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding detection UTF8 BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); return fb.bom === 'utf8' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding detection UTF16be BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16BE.txt"); return fb.bom === 'utf16be' && fb.encoding === 'utf16be'; })); testRunner.addTest(new TestCase("Check encoding detection UTF16le BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16LE.txt"); return fb.bom === 'utf16le' && fb.encoding === 'utf16le'; })); testRunner.addTest(new TestCase("Check encoding on 1 bytes file", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\1bytefile.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding on 0 bytes file", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\0bytefile.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); // UTF8 encoding tests testRunner.addTest(new TestCase("Check byte reader", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var chars = []; for (var i = 0; i < 11; i++) { chars.push(fb.readByte()); } return TestRunner.arrayCompare(chars, [0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]); })); testRunner.addTest(new TestCase("Check UTF8 decoding", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var chars = []; for (var i = 0; i < 6; i++) { chars.push(fb.readUtf8CodePoint()); } return TestRunner.arrayCompare(chars, [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]); })); testRunner.addTest(new TestCase("Check UTF8 encoding", function () { var fb = new FileManager.FileBuffer(20); fb.writeUtf8Bom(); var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; for (var i in chars) { fb.writeUtf8CodePoint(chars[i]); } fb.index = 0; var bytes = []; for (var i = 0; i < 14; i++) { bytes.push(fb.readByte()); } var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; return TestRunner.arrayCompare(bytes, expected); })); // Test reading and writing files testRunner.addTest(new TestCase("Check saving a file", function () { var filename = TestFileDir + "\\tmpUTF16LE.txt"; var fb = new FileManager.FileBuffer(14); fb.writeUtf16leBom(); var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; chars.forEach(function (val) { fb.writeUtf16CodePoint(val, false); }); fb.save(filename); var savedFile = new FileManager.FileBuffer(filename); if (savedFile.encoding !== 'utf16le') { throw Error("Incorrect encoding"); } var expectedBytes = [0xFF, 0xFE, 0x54, 0x00, 0xE8, 0x00, 0x23, 0x1D, 0x20, 0x20, 0x0D, 0x00, 0x0A, 0x00] savedFile.index = 0; expectedBytes.forEach(function (val) { var byteVal = savedFile.readByte(); if (byteVal !== val) { throw Error("Incorrect byte value"); } }); return true; })); testRunner.addTest(new TestCase("Check reading past buffer asserts", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var result = fb.readByte(200); return true; }, "read beyond buffer length")); testRunner.addTest(new TestCase("Check writing past buffer asserts", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); fb.writeByte(5, 200); return true; }, "write beyond buffer length")); // Non-BMP unicode char tests testRunner.addTest(new TestCase("Read non-BMP utf16 chars", function () { var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf16leNonBmp.txt"); if (savedFile.encoding !== 'utf16le') { throw Error("Incorrect encoding"); } var codePoints = []; for (var i = 0; i < 6; i++) { codePoints.push(savedFile.readUtf16CodePoint(false)); } var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; return TestRunner.arrayCompare(codePoints, expectedCodePoints); })); testRunner.addTest(new TestCase("Read non-BMP utf8 chars", function () { var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf8NonBmp.txt"); if (savedFile.encoding !== 'utf8') { throw Error("Incorrect encoding"); } var codePoints = []; for (var i = 0; i < 6; i++) { codePoints.push(savedFile.readUtf8CodePoint()); } var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; return TestRunner.arrayCompare(codePoints, expectedCodePoints); })); testRunner.addTest(new TestCase("Write non-BMP utf8 chars", function () { var filename = TestFileDir + "\\tmpUTF8nonBmp.txt"; var fb = new FileManager.FileBuffer(15); var chars = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; chars.forEach(function (val) { fb.writeUtf8CodePoint(val); }); fb.save(filename); var savedFile = new FileManager.FileBuffer(filename); if (savedFile.encoding !== 'utf8') { throw Error("Incorrect encoding"); } var expectedBytes = [0xF0, 0x90, 0x92, 0x80, 0xF0, 0x90, 0x92, 0x81, 0xF0, 0x90, 0x92, 0x82, 0x54, 0x68, 0x69]; expectedBytes.forEach(function (val) { var byteVal = savedFile.readByte(); if (byteVal !== val) { throw Error("Incorrect byte value"); } }); return true; })); testRunner.addTest(new TestCase("Test invalid lead UTF8 byte", function () { var filename = TestFileDir + "\\utf8BadLeadByte.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Invalid UTF8 byte sequence at index: 4")); testRunner.addTest(new TestCase("Test invalid tail UTF8 byte", function () { var filename = TestFileDir + "\\utf8InvalidTail.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trailing byte invalid at index: 8")); testRunner.addTest(new TestCase("Test ANSI fails validation", function () { var filename = TestFileDir + "\\ansi.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trailing byte invalid at index: 6")); testRunner.addTest(new TestCase("Test UTF-16LE with invalid surrogate trail fails", function () { var filename = TestFileDir + "\\utf16leInvalidSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trail surrogate has an invalid value")); testRunner.addTest(new TestCase("Test UTF-16BE with invalid surrogate head fails", function () { var filename = TestFileDir + "\\UTF16BEInvalidSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Byte sequence starts with a trail surrogate")); testRunner.addTest(new TestCase("Test UTF-16LE with missing trail surrogate fails", function () { var filename = TestFileDir + "\\utf16leMissingTrailSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trail surrogate has an invalid value")); // Count of CRs & LFs testRunner.addTest(new TestCase("Count character occurrences", function () { var filename = TestFileDir + "\\charCountASCII.txt"; var fb = new FileManager.FileBuffer(filename); var result = (fb.countCR === 5 && fb.countLF === 4 && fb.countCRLF === 5 && fb.countHT === 3); return result; })); // Control characters in text testRunner.addTest(new TestCase("Test file with control character", function () { var filename = TestFileDir + "\\controlChar.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Codepoint at index: 3 has control value: 8")); return testRunner;}) : () => TestRunner
208 >function () { var testRunner = new TestRunner(); // First 3 are for simple harness validation testRunner.addTest(new TestCase("Basic test", function () { return true; })); testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, "")); testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass")); testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); })); testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); })); // File detection tests testRunner.addTest(new TestCase("Check file exists", function () { return FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test.txt"); })); testRunner.addTest(new TestCase("Check file doesn't exist", function () { return !FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test2.txt"); })); // File pattern matching tests testRunner.addTest(new TestCase("Check text file match", function () { return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) })); testRunner.addTest(new TestCase("Check makefile match", function () { return FileManager.FileBuffer.isTextFile("C:\\some dir\\makefile"); })); testRunner.addTest(new TestCase("Check binary file doesn't match", function () { return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") && !FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll")); })); // Command-line parameter tests testRunner.addTest(new TestCase("Check App defaults", function () { var app = new App.App([]); return (app.fixLines === false && app.recurse === true && app.lineEndings === "CRLF" && app.matchPattern === undefined && app.rootDirectory === ".\\" && app.encodings[0] === "ascii" && app.encodings[1] === "utf8nobom"); })); testRunner.addTest(new TestCase("Check App params", function () { var app = new App.App(["-dir=C:\\test dir", "-lineEndings=LF", "-encodings=utf16be,ascii", "-recurse=false", "-fixlines"]); return (app.fixLines === true && app.lineEndings === "LF" && app.recurse === false && app.matchPattern === undefined && app.rootDirectory === "C:\\test dir" && app.encodings[0] === "utf16be" && app.encodings[1] === "ascii" && app.encodings.length === 2); })); // File BOM detection tests testRunner.addTest(new TestCase("Check encoding detection no BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\noBOM.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding detection UTF8 BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); return fb.bom === 'utf8' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding detection UTF16be BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16BE.txt"); return fb.bom === 'utf16be' && fb.encoding === 'utf16be'; })); testRunner.addTest(new TestCase("Check encoding detection UTF16le BOM", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16LE.txt"); return fb.bom === 'utf16le' && fb.encoding === 'utf16le'; })); testRunner.addTest(new TestCase("Check encoding on 1 bytes file", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\1bytefile.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); testRunner.addTest(new TestCase("Check encoding on 0 bytes file", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\0bytefile.txt"); return fb.bom === 'none' && fb.encoding === 'utf8'; })); // UTF8 encoding tests testRunner.addTest(new TestCase("Check byte reader", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var chars = []; for (var i = 0; i < 11; i++) { chars.push(fb.readByte()); } return TestRunner.arrayCompare(chars, [0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]); })); testRunner.addTest(new TestCase("Check UTF8 decoding", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var chars = []; for (var i = 0; i < 6; i++) { chars.push(fb.readUtf8CodePoint()); } return TestRunner.arrayCompare(chars, [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]); })); testRunner.addTest(new TestCase("Check UTF8 encoding", function () { var fb = new FileManager.FileBuffer(20); fb.writeUtf8Bom(); var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; for (var i in chars) { fb.writeUtf8CodePoint(chars[i]); } fb.index = 0; var bytes = []; for (var i = 0; i < 14; i++) { bytes.push(fb.readByte()); } var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; return TestRunner.arrayCompare(bytes, expected); })); // Test reading and writing files testRunner.addTest(new TestCase("Check saving a file", function () { var filename = TestFileDir + "\\tmpUTF16LE.txt"; var fb = new FileManager.FileBuffer(14); fb.writeUtf16leBom(); var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; chars.forEach(function (val) { fb.writeUtf16CodePoint(val, false); }); fb.save(filename); var savedFile = new FileManager.FileBuffer(filename); if (savedFile.encoding !== 'utf16le') { throw Error("Incorrect encoding"); } var expectedBytes = [0xFF, 0xFE, 0x54, 0x00, 0xE8, 0x00, 0x23, 0x1D, 0x20, 0x20, 0x0D, 0x00, 0x0A, 0x00] savedFile.index = 0; expectedBytes.forEach(function (val) { var byteVal = savedFile.readByte(); if (byteVal !== val) { throw Error("Incorrect byte value"); } }); return true; })); testRunner.addTest(new TestCase("Check reading past buffer asserts", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); var result = fb.readByte(200); return true; }, "read beyond buffer length")); testRunner.addTest(new TestCase("Check writing past buffer asserts", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); fb.writeByte(5, 200); return true; }, "write beyond buffer length")); // Non-BMP unicode char tests testRunner.addTest(new TestCase("Read non-BMP utf16 chars", function () { var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf16leNonBmp.txt"); if (savedFile.encoding !== 'utf16le') { throw Error("Incorrect encoding"); } var codePoints = []; for (var i = 0; i < 6; i++) { codePoints.push(savedFile.readUtf16CodePoint(false)); } var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; return TestRunner.arrayCompare(codePoints, expectedCodePoints); })); testRunner.addTest(new TestCase("Read non-BMP utf8 chars", function () { var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf8NonBmp.txt"); if (savedFile.encoding !== 'utf8') { throw Error("Incorrect encoding"); } var codePoints = []; for (var i = 0; i < 6; i++) { codePoints.push(savedFile.readUtf8CodePoint()); } var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; return TestRunner.arrayCompare(codePoints, expectedCodePoints); })); testRunner.addTest(new TestCase("Write non-BMP utf8 chars", function () { var filename = TestFileDir + "\\tmpUTF8nonBmp.txt"; var fb = new FileManager.FileBuffer(15); var chars = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; chars.forEach(function (val) { fb.writeUtf8CodePoint(val); }); fb.save(filename); var savedFile = new FileManager.FileBuffer(filename); if (savedFile.encoding !== 'utf8') { throw Error("Incorrect encoding"); } var expectedBytes = [0xF0, 0x90, 0x92, 0x80, 0xF0, 0x90, 0x92, 0x81, 0xF0, 0x90, 0x92, 0x82, 0x54, 0x68, 0x69]; expectedBytes.forEach(function (val) { var byteVal = savedFile.readByte(); if (byteVal !== val) { throw Error("Incorrect byte value"); } }); return true; })); testRunner.addTest(new TestCase("Test invalid lead UTF8 byte", function () { var filename = TestFileDir + "\\utf8BadLeadByte.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Invalid UTF8 byte sequence at index: 4")); testRunner.addTest(new TestCase("Test invalid tail UTF8 byte", function () { var filename = TestFileDir + "\\utf8InvalidTail.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trailing byte invalid at index: 8")); testRunner.addTest(new TestCase("Test ANSI fails validation", function () { var filename = TestFileDir + "\\ansi.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trailing byte invalid at index: 6")); testRunner.addTest(new TestCase("Test UTF-16LE with invalid surrogate trail fails", function () { var filename = TestFileDir + "\\utf16leInvalidSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trail surrogate has an invalid value")); testRunner.addTest(new TestCase("Test UTF-16BE with invalid surrogate head fails", function () { var filename = TestFileDir + "\\UTF16BEInvalidSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Byte sequence starts with a trail surrogate")); testRunner.addTest(new TestCase("Test UTF-16LE with missing trail surrogate fails", function () { var filename = TestFileDir + "\\utf16leMissingTrailSurrogate.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Trail surrogate has an invalid value")); // Count of CRs & LFs testRunner.addTest(new TestCase("Count character occurrences", function () { var filename = TestFileDir + "\\charCountASCII.txt"; var fb = new FileManager.FileBuffer(filename); var result = (fb.countCR === 5 && fb.countLF === 4 && fb.countCRLF === 5 && fb.countHT === 3); return result; })); // Control characters in text testRunner.addTest(new TestCase("Test file with control character", function () { var filename = TestFileDir + "\\controlChar.txt"; var fb = new FileManager.FileBuffer(filename); return true; }, "Codepoint at index: 3 has control value: 8")); return testRunner;} : () => TestRunner
354 >testRunner.addTest(new TestCase("Check text file match", function () { return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) })) : void
358 >new TestCase("Check text file match", function () { return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) }) : TestCase
363 >function () { return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) } : () => any
366 >(FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) : any
367 >FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js") : any
368 >FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") : any
377 FileManager.FileBuffer.isTextFile("C:\\spaces path\\myap [all...] |
| /third_party/python/ |
| H A D | Makefile.pre.in | 611 echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\ 612 echo "Please add it to PATH and run ./configure again" ;\ 666 --path $(realpath $(abs_srcdir)) \ 712 # sys.path fixup -- see Modules/getpath.c. 818 # --preload-file turns a relative asset path into an absolute path. 999 # script is used to test the cross compile code path. 2401 find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_tes [all...] |
| /test/xts/acts/storage/storagefileiojstest/entry/src/ohosTest/js/test/ |
| H A D | FileIO.test.js | 1185 expect(err.message == "Invalid path").assertTrue(); 1355 expect(err.message == "Invalid path").assertTrue(); 1836 * @tc.desc Function of API, copy. fpatch is vaild, fpathTarget is vaild, same path, file not same. 1856 * @tc.desc Function of API, copy. fpatch is invalid, fpathTarget is vaild, same path, file not same. 1888 * @tc.desc Function of API, copy. fpatch is vaild, fpathTarget is vaild, path not same, file not same. 1908 * @tc.desc Function of API, copy. fpatch is vaild, fpathTarget is vaild, path not same, file not same. 1928 * @tc.desc Function of API, copy. fpatch is vaild, fpathTarget is vaild, path not same, file not same. 2074 * @tc.desc Function of API, copy. fpatch is vaild, fpathTarget is vaild, same path, file not same, mode is 0. 2094 * @tc.desc Function of API, copy. fpatch is vaild, fpathTarget is vaild, same path, file not same, mode is 0. 2569 expect(err.message == "Invalid path") [all...] |
| /third_party/icu/icu4j/demos/src/com/ibm/icu/dev/demo/translit/resources/ |
| H A D | Transliterator_Kanji_English.txt | 1355 嶝>'[path leading up a mountain]'; 1553 径>'[narrow path]'; 1561 徑>'[narrow path]'; 3320 甬>'[path]'; 3327 町>'[raised path between fields]'; 3329 甼>'[raised path between fields]'; 3339 畔>'[boundary path dividing fields]'; 3359 畷>'[raised path between fields]'; 5440 道>'[path]'; 5761 陌>'[foot path betwee [all...] |
| /third_party/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/ |
| H A D | Normalizer2Impl.java | 1103 // Fast path: Scan over a sequence of characters below the minimum "no or maybe" code point, in compose() 1142 // Medium-fast path: Handle cases that do not require full decomposition and recomposition. in compose() 1147 // Fast path for mapping a character that is immediately surrounded by boundaries. in compose() 1188 // Fall through to the slow path. in compose() 1223 // If we see L+V+x where x!=T then we drop to the slow path, in compose() 1229 // or use the slow path. in compose() 1247 // Fall through to the slow path. in compose() 1293 // Use the slow path. There is no boundary in [prevSrc, src[. in compose() 1297 // Slow path: Find the nearest boundaries around the current character, in compose() 1342 // Fast path in composeQuickCheck() [all...] |
| /third_party/icu/ohos_icu4j/src/main/java/ohos/global/icu/impl/ |
| H A D | Normalizer2Impl.java | 1112 // Fast path: Scan over a sequence of characters below the minimum "no or maybe" code point, in compose() 1151 // Medium-fast path: Handle cases that do not require full decomposition and recomposition. in compose() 1156 // Fast path for mapping a character that is immediately surrounded by boundaries. in compose() 1197 // Fall through to the slow path. in compose() 1232 // If we see L+V+x where x!=T then we drop to the slow path, in compose() 1238 // or use the slow path. in compose() 1256 // Fall through to the slow path. in compose() 1302 // Use the slow path. There is no boundary in [prevSrc, src[. in compose() 1306 // Slow path: Find the nearest boundaries around the current character, in compose() 1351 // Fast path in composeQuickCheck() [all...] |
| /third_party/mesa3d/src/compiler/nir/ |
| H A D | nir_lower_io.c | 235 nir_deref_path path; in get_io_offset() local 236 nir_deref_path_init(&path, deref, NULL); in get_io_offset() 238 assert(path.path[0]->deref_type == nir_deref_type_var); in get_io_offset() 239 nir_deref_instr **p = &path.path[1]; in get_io_offset() 250 if (path.path[0]->var->data.compact) { in get_io_offset() 274 /* p starts at path[1], so this is safe */ in get_io_offset() 287 nir_deref_path_finish(&path); in get_io_offset() [all...] |
| /third_party/node/deps/openssl/openssl/ |
| H A D | INSTALL.md | 205 the global search path for system libraries. 403 already on the system include path. 410 If not provided the system library path will be used. 413 without a path). This flag must be provided if the 417 **On VMS:** this is the filename of the zlib library (with or without a path). 512 This option will enable the use of the Kernel TLS data-path, which can improve 516 Kernel TLS data-path. 1236 $ /PATH/TO/OPENSSL/SOURCE/Configure [[ options ]] 1243 $ perl D:[PATH.TO.OPENSSL.SOURCE]Configure [[ options ]] 1250 $ perl d:\PATH\T [all...] |
| /third_party/rust/crates/libc/src/unix/linux_like/ |
| H A D | mod.rs | 1673 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; in statfs() 1674 pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int; in statfs64() 1677 pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int; in statvfs64() 1691 path: *const ::c_char, in utimensat() 1699 pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int; in creat64() 1709 pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int; in lstat64() 1718 pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; in open64() 1719 pub fn openat64(fd: ::c_int, path: *const c_char, oflag: ::c_int, ...) -> ::c_int; in openat64() 1733 pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; in stat64() 1734 pub fn truncate64(path in stat64() [all...] |
| /third_party/openssl/ |
| H A D | INSTALL.md | 205 the global search path for system libraries. 403 already on the system include path. 410 If not provided the system library path will be used. 413 without a path). This flag must be provided if the 417 **On VMS:** this is the filename of the zlib library (with or without a path). 512 This option will enable the use of the Kernel TLS data-path, which can improve 516 Kernel TLS data-path. 1224 $ /PATH/TO/OPENSSL/SOURCE/Configure [[ options ]] 1231 $ perl D:[PATH.TO.OPENSSL.SOURCE]Configure [[ options ]] 1238 $ perl d:\PATH\T [all...] |
| /third_party/skia/third_party/externals/spirv-cross/ |
| H A D | main.cpp | 244 static vector<uint32_t> read_spirv_file(const char *path) in read_spirv_file() argument 246 if (path[0] == '-' && path[1] == '\0') in read_spirv_file() 249 FILE *file = fopen(path, "rb"); in read_spirv_file() 252 fprintf(stderr, "Failed to open SPIR-V file: %s\n", path); in read_spirv_file() 268 static bool write_string_to_file(const char *path, const char *string) in write_string_to_file() argument 270 FILE *file = fopen(path, "w"); in write_string_to_file() 273 fprintf(stderr, "Failed to write file: %s\n", path); in write_string_to_file() 947 "\t[--output <output path>]: If not provided, prints output to stdout.\n" in print_help() 1707 // Special case reflection because it has little to do with the path followe in main_inner() [all...] |
| /third_party/pcre2/pcre2/doc/html/ |
| H A D | pcre2grep.html | 64 arguments are treated as path names. At least one of <b>-e</b>, <b>-f</b>, or an 298 If an input path is not a regular file or a directory, "action" specifies how 300 (silently skip the path). 304 If an input path is a directory, "action" specifies how it is to be processed. 307 "skip" (silently skip the path, the default in Windows environments). In the 336 file name, not the entire path. The <b>-F</b>, <b>-w</b>, and <b>-x</b> options do 357 name, not the entire path. The <b>-F</b>, <b>-w</b>, and <b>-x</b> options do not 462 the entire path. The <b>-F</b>, <b>-w</b>, and <b>-x</b> options do not apply to 481 the final component of the directory name, not the entire path. The <b>-F</b>, 768 If any given path i [all...] |
| /third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Analysis/ |
| H A D | MemorySSA.cpp | 607 /// may or may not be present in the path of defs from LastNode..SearchStart, 635 // If we've already visited this path with this MemoryLocation, we don't in getBlockingAccess() 680 // We've hit our target. Save this path off for if we want to continue in getBlockingAccess() 682 // we've reached back to the OriginalAccess, do not save path, we've in getBlockingAccess() 737 /// The path that contains our result. 763 /// A path is a series of {MemoryAccess, MemoryLocation} pairs. A path 784 assert(!Paths.empty() && "Need a path to move"); in tryOptimizePhi() 825 // above this phi, whereas the other can. If we cache the second path in tryOptimizePhi() 947 // Fast path fo in findClobber() [all...] |
| /third_party/typescript/tests/baselines/reference/tsserver/projectReferencesSourcemap/dependencyAndUsage/disabledSourceRef/ |
| H A D | dependency-dts-deleted.js | 40 {"compilerOptions":{"composite":true,"declarationMap":true,"disableSourceOfProjectReferenceRedirect":true},"references":[{"path":"../dependency"}]}
203 Info 2 [00:01:05.000] Search path: /user/username/projects/myproject/main
219 "path": "/user/username/projects/myproject/dependency", 265 Info 26 [00:01:29.000] Search path: /user/username/projects/myproject/main
339 Info 30 [00:01:39.000] Search path: /user/username/projects/myproject/dependency
360 Info 42 [00:01:51.000] Search path: /user/username/projects/myproject/dependency
444 Info 46 [00:02:06.000] Search path: /user/username/projects/myproject/random
699 Info 67 [00:02:43.000] Search path: /user/username/projects/myproject/dependency
2232 Info 113 [00:03:44.000] Search path: /user/username/projects/myproject/random
2651 Info 128 [00:04:51.000] Search path [all...] |
| H A D | dependency-dtsMap-deleted.js | 40 {"compilerOptions":{"composite":true,"declarationMap":true,"disableSourceOfProjectReferenceRedirect":true},"references":[{"path":"../dependency"}]}
203 Info 2 [00:01:05.000] Search path: /user/username/projects/myproject/main
219 "path": "/user/username/projects/myproject/dependency", 265 Info 26 [00:01:29.000] Search path: /user/username/projects/myproject/main
339 Info 30 [00:01:39.000] Search path: /user/username/projects/myproject/dependency
360 Info 42 [00:01:51.000] Search path: /user/username/projects/myproject/dependency
444 Info 46 [00:02:06.000] Search path: /user/username/projects/myproject/random
699 Info 67 [00:02:43.000] Search path: /user/username/projects/myproject/dependency
2239 Info 109 [00:03:40.000] Search path: /user/username/projects/myproject/random
2673 Info 123 [00:04:46.000] Search path [all...] |
| /third_party/python/Lib/idlelib/ |
| H A D | ChangeLog | 322 the path to the Windows Doc directory (relative to python.exe). 324 Windows use a hard coded path relative to the location of this 613 Find the help.txt file relative to __file__ or ".", not in sys.path. 628 same directory as __file__, rather than searching for it along sys.path. 1069 sys.path is absolutized, and all relevant paths are inserted into it. 1156 * PathBrowser.py: Don't crash when sys.path contains an empty string. 1172 * PathBrowser.py: "Path browser" - 4 scrolled lists displaying: 1173 directories on sys.path 1233 * PyShell.py: Add current dir or paths of file args to sys.path. 1405 Fix the class browser to work even when the file is not on sys.path [all...] |