summaryrefslogtreecommitdiff
path: root/test/pseudo-tty
AgeCommit message (Collapse)Author
2018-04-29assert: make skipping indicator blueRuben Bridgewater
If lines gets skipped, they are marked with three dots. This makes sure they are better visualized to distinguish them from everything else. PR-URL: https://github.com/nodejs/node/pull/20315 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-04-14assert: improve default error messagesRuben Bridgewater
This improves the error messages for: - assert.notDeepStrictEqual - assert.deepStrictEqual - assert.notStrictEqual - assert.strictEqual Those will now always use the same error message as used in the strict mode. PR-URL: https://github.com/nodejs/node/pull/19467 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-12console: auto-detect color support by defaultAnna Henningsen
This makes Node pretty-print objects with color by default when `console.log()`-ing them. PR-URL: https://github.com/nodejs/node/pull/19372 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-27test: improve tty.getColorDepth coverageRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/19446 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2018-03-27assert: fix diff color outputRuben Bridgewater
The color output was broken at some point and that was not detected because it was not tested for properly so far. This makes sure the colors work again and it adds a regression test as well. PR-URL: https://github.com/nodejs/node/pull/19464 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-02-22test: really test the ttywrap bits of getasyncidJeremiah Senkpiel
Follow-up from https://github.com/nodejs/node/pull/18800 Code that tries to exercise tty fds must be placed in `/pseudo-tty/`. PR-URL: https://github.com/nodejs/node/pull/18886 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-20test: actually test tty `getColorDepth()`Jeremiah Senkpiel
TTY tests should almost never be placed in `/parallel/`. Skipping TTY tests there due to missing tty fds just means they will never be run, ever, on any system. This moves the tty-get-color-depth test to `/pseudo-tty/` where the test runner will actually make a pty fd. Refs: https://github.com/nodejs/node/pull/17615 PR-URL: https://github.com/nodejs/node/pull/18800 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-15tty: fix 'resize' event regressionBen Noordhuis
It's not wholly clear what commit introduced the regression but between v8.4.0 and v8.5.0 the 'resize' event stopped getting emitted when the tty was resized. The SIGWINCH event listener apparently was being installed before the support code for `process.on('SIGWINCH', ...)` was. Fix that by moving said support code to real early in the bootstrap process. This commit also seems to fix a Windows-only "write EINVAL" error for reasons even less well-understood... Fixes: https://github.com/nodejs/node/issues/16141 Fixes: https://github.com/nodejs/node/issues/16194 PR-URL: https://github.com/nodejs/node/pull/16225 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-11-14test: add coverage to tty modulecjihrig
PR-URL: https://github.com/nodejs/node/pull/16959 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-10-22tty,doc: add type-check to isattyBryan English
Previously, various inputs other than non-negative integers would produce incorrect results. Added type-checking on input, returning false for anything other than non-negative integers. Also clarified in docs. PR-URL: https://github.com/nodejs/node/pull/15567 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-07-27test: adjust indentation for stricter lintingRich Trott
ESLint 4.x has stricter linting than previous versions. We are currently using the legacy indentation rules in the test directory. This commit changes the indentation of files to comply with the stricter 4.x linting and enable stricter linting in the test directory. PR-URL: https://github.com/nodejs/node/pull/14431 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2017-07-16test: change isAix to isAIX章礼平
This makes the naming more consistent with existing properties like isFreeBSD where the capitalization of the property name is consistent with the conventional styling of the operating system. PR-URL: https://github.com/nodejs/node/pull/14263 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Bryan English <bryan@bryanenglish.com>
2017-07-03test: remove common.noopRich Trott
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() => {}`. So, I propose removing it. PR-URL: https://github.com/nodejs/node/pull/12822 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-22stream: add destroy and _destroy methods.Matteo Collina
Adds destroy() and _destroy() methods to Readable, Writable, Duplex and Transform. It also standardizes the behavior and the implementation of destroy(), which has been inconsistent in userland and core. This PR also updates all the subsystems of core to use the new destroy(). PR-URL: https://github.com/nodejs/node/pull/12925 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-05test: reduce string concatenationsVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-04-20errors: port internal/process errors to internal/errorsJames M Snell
* Assign codes to the handful of errors reported by internal/process/*.js * Include documentation for the new error codes * Improve error messages * Improve test coverage for process.nextTick PR-URL: https://github.com/nodejs/node/pull/11294 Ref: https://github.com/nodejs/node/issues/11273 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
2017-03-26test: add common.noop, default for common.mustCall()James M Snell
Export a new common.noop no-operation function for general use. Allow using common.mustCall() without a fn argument to simplify test cases. Replace various non-op functions throughout tests with common.noop PR-URL: https://github.com/nodejs/node/pull/12027 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-17test: delay child exit in AIX for pseudo-tty testsGireesh Punathil
The tests in pseudo-tty takes the form of child node writing some data and exiting, while parent python consume them through pseudo tty implementations, and validate the result. While there is no synchronization between child and parent, this works for most platforms, except AIX, where the child exits even before the parent could setup the read loop, under race conditions Fixing the race condition is ideally done through sending ACK messages to and forth, but involves massive changes and have side effect. The workaround is to address them in AIX alone, by adding a reasonable delay. PR-URL: https://github.com/nodejs/node/pull/11715 Fixes: https://github.com/nodejs/node/issues/7973 Fixes: https://github.com/nodejs/node/issues/9765 Fixes: https://github.com/nodejs/node/issues/11541 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-02-28tty: add ref() so process.stdin.ref() etc. workBen Schmidt
Also squashed from: * test: move tty-wrap isrefed test to pseudo-tty/ * test: test tty-wrap handle isrefed properly * test: improve failure messages in isrefed tests PR-URL: https://github.com/nodejs/node/pull/7360 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-01-31test: require handler to be run in sigwinch testRich Trott
Use `common.mustCall()` to guarantee that the wrapped `_refreshSize()` functions are invoked. PR-URL: https://github.com/nodejs/node/pull/11068 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michal Zasso <targos@protonmail.com>
2017-01-11test: use eslint to fix var->const/letGibson Fahnestock
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-05test: mark test-tty-wrap as flaky for AIXMichael Dawson
We have had https://github.com/nodejs/node/issues/9728 open for a while but the frequency of the failures seems to be such that we should mark it as flaky while we continue to investigate. PR-URL: https://github.com/nodejs/node/pull/10618 Reviewed-by: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-27test: add test for SIGWINCH handling by stdio.jsSarah Meyer
PR-URL: https://github.com/nodejs/node/pull/10063 Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-12test: fail for missing output filesAnna Henningsen
Instead of ignoring missing `.out` files for message/pseudo-tty tests, raise an error to indicate that something is not quite right. Ref: https://github.com/nodejs/node/pull/10037 PR-URL: https://github.com/nodejs/node/pull/10150 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-12-09test: add stdin-setrawmode.out fileJonathan Darling
Adds an accompanying .out file for test/pseudo-tty/stdin-setrawmode.js. The test was originally merged without this file and an astute observer found that it was causing an error message. See discussion at https://github.com/nodejs/node/pull/10037. PR-URL: https://github.com/nodejs/node/pull/10149 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-12-05test: add test for process.stdin.setRawMode()Jonathan Darling
adds a basic test for process.stdin.setRawMode to ensure that the isRaw property is properly changed PR-URL: https://github.com/nodejs/node/pull/10037 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-11-25test: exclude no_interleaved_stdio test for AIXMichael Dawson
pseudo-tty/no_interleaved_stdio has hung a few times in the last couple of days on AIX. We believe it is not a Node.js issue but an issue with python on AIX. Its being investigated under: https://github.com/nodejs/node/issues/7973. Excluding this additional test until we can resolve the python issue. Fixes https://github.com/nodejs/node/issues/9765 PR-URL: https://github.com/nodejs/node/pull/9772 Reviewed-By: Sam Roberts <sam@strongloop.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2016-09-12test: skip pseudo-tty/no_dropped_stdio testMichael Dawson
We had marked it as flaky but in some failures it hangs and does not seem to timeout, and or is reported as an error. Also add prefix to status file as it was missing. Also fix name of status file in testcfg.py. It was pointing to message.status instead of pseudo-tty.status. PR-URL: https://github.com/nodejs/node/pull/8470 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-09-06test: mark pseudo-tty/no_dropped_stdio as flakyMichael Dawson
We've determined there is a test issue related to python as opposed to node, mark as flaky until we can resolve PR-URL: https://github.com/nodejs/node/pull/8385 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-07-11test: fix old tty testsJeremiah Senkpiel
test-tty-wrap hasn’t worked since StreamBase was introduced, I think. test-tty-stdout-end also happens to works with PipeWrap-s. Refs: https://github.com/nodejs/node/pull/7360 PR-URL: https://github.com/nodejs/node/pull/7613 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-07-11test: move parallel/test-tty-* to pseudo-tty/Jeremiah Senkpiel
Refs: https://github.com/nodejs/node/pull/7360 PR-URL: https://github.com/nodejs/node/pull/7613 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-06-01test: test TTY problems by fakeing a TTY using openptyJeremiah Senkpiel
Many thanks to thefourtheye and addaleax who helped make the python bits of this possible. See https://github.com/nodejs/node/issues/6980 for more info regarding the related TTY issues. Refs: https://github.com/nodejs/node/issues/6456 Refs: https://github.com/nodejs/node/pull/6773 Refs: https://github.com/nodejs/node/pull/6816 PR-URL: https://github.com/nodejs/node/pull/6895 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Anna Henningsen <anna@addaleax.net>