node/test
Ian Harris 9decb70d05
readline: fix issue with newline-less last line
The logic for reading lines was slightly flawed, in that it assumed
there would be a final new line. It handled the case where there are no
new lines, but this then broke if there were some new lines.

The fix in logic is basically removing the special case where there are
no new lines by changing it to always read the final line with no new
lines. This works because if a file contains no new lines, the final
line is the first line, and all is well.

There is some subtlety in this functioning, however. If the last line
contains no new lines, then `lastIndex` will be the start of the last
line, and `kInsertString` will be called from that point. If it does
contain a new line, `lastIndex` will be equal to `s.length`, so the
slice will be the empty string.

Fixes: https://github.com/nodejs/node/issues/47305
PR-URL: https://github.com/nodejs/node/pull/47317
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-04-14 10:12:16 +00:00
..
abort test: remove unreachable return 2023-02-25 13:28:00 +00:00
addons src,process: add permission model 2023-02-23 18:11:51 +00:00
async-hooks async_hooks: remove experimental onPropagate option 2023-02-01 07:37:05 -08:00
benchmark url: drop ICU requirement for parsing hostnames 2023-04-05 09:05:29 -07:00
cctest quic: add additional quic implementation utilities 2023-03-31 09:58:37 -07:00
common test: migrate test runner message tests to snapshot 2023-04-10 03:06:22 +03:00
doctool test: run doctool tests in parallel 2023-04-04 21:02:47 +02:00
embedding src: fix some recently introduced coverity issues 2023-03-28 09:07:55 -04:00
es-module esm: move hook execution to separate thread 2023-04-13 09:35:17 +02:00
fixtures readline: fix issue with newline-less last line 2023-04-14 10:12:16 +00:00
fuzzers url: replace url-parser with ada 2023-02-06 19:21:39 +00:00
internet net: enable autoSelectFamily by default 2023-04-05 08:31:56 -07:00
js-native-api node-api: extend type-tagging to externals 2023-03-22 04:47:08 +00:00
known_issues test: remove stale entry from known_issues.status 2023-04-08 16:22:35 +00:00
message test: migrate test runner message tests to snapshot 2023-04-10 03:06:22 +03:00
node-api node-api: deprecate napi_module_register 2023-03-24 14:00:40 -04:00
overlapped-checker
parallel readline: fix issue with newline-less last line 2023-04-14 10:12:16 +00:00
pseudo-tty test_runner: report failing tests after summary 2023-03-23 18:45:53 +00:00
pummel src: bootstrap Web [Exposed=*] APIs in the shadow realm 2023-03-16 00:22:06 +08:00
report
sequential test: mark test-cluster-primary-error flaky on asan 2023-04-14 03:51:46 +00:00
testpy
tick-processor
tools
v8-updates
wasi wasi: make returnOnExit true by default 2023-04-11 16:35:52 -04:00
wpt url: drop ICU requirement for parsing hostnames 2023-04-05 09:05:29 -07:00
.eslintrc.yaml test: add trailing commas in `test/pummel` 2023-02-12 17:36:39 +01:00
README.md
root.status

README.md

Node.js Core Tests

This directory contains code and data used to test the Node.js implementation.

For a detailed guide on how to write tests in this directory, see the guide on writing tests.

On how to run tests in this directory, see the contributing guide.

For the tests to run on Windows, be sure to clone Node.js source code with the autocrlf git config flag set to true.

Test Directories

Directory Runs on CI Purpose
abort Yes Tests that use --abort-on-uncaught-exception and other situations where we want to test something but avoid generating a core file.
addons Yes Tests for addon functionality along with some tests that require an addon.
async-hooks Yes Tests for async_hooks functionality.
benchmark Yes Test minimal functionality of benchmarks.
cctest Yes C++ tests that are run as part of the build process.
code-cache No Tests for a Node.js binary compiled with V8 code cache.
common Common modules shared among many tests. Documentation
doctool Yes Tests for the documentation generator.
es-module Yes Test ESM module loading.
fixtures Test fixtures used in various tests throughout the test suite.
internet No Tests that make real outbound network connections. Tests for networking related modules may also be present in other directories, but those tests do not make outbound connections.
js-native-api Yes Tests for Node.js-agnostic Node-API functionality.
known_issues Yes Tests reproducing known issues within the system. All tests inside of this directory are expected to fail. If a test doesn't fail on certain platforms, those should be skipped via known_issues.status.
message Yes Tests for messages that are output for various conditions (console.log, error messages etc.)
node-api Yes Tests for Node.js-specific Node-API functionality.
parallel Yes Various tests that are able to be run in parallel.
pseudo-tty Yes Tests that require stdin/stdout/stderr to be a TTY.
pummel No Various tests for various modules / system functionality operating under load.
sequential Yes Various tests that must not run in parallel.
testpy Test configuration utility used by various test suites.
tick-processor No Tests for the V8 tick processor integration. The tests are for the logic in lib/internal/v8_prof_processor.js and lib/internal/v8_prof_polyfill.js. The tests confirm that the profile processor packages the correct set of scripts from V8 and introduces the correct platform specific logic.
v8-updates No Tests for V8 performance integration.