src: fix SplitString to ignore white spaces
PR-URL: https://github.com/nodejs/node/pull/26545 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Khaidi Chu <i@2333.moe>
This commit is contained in:
parent
a4d4e9d721
commit
17ab2ed3c8
@ -134,6 +134,7 @@ std::vector<std::string> SplitString(const std::string& in, char delim) {
|
||||
while (in_stream.good()) {
|
||||
std::string item;
|
||||
std::getline(in_stream, item, delim);
|
||||
if (item.empty()) continue;
|
||||
out.emplace_back(std::move(item));
|
||||
}
|
||||
return out;
|
||||
|
@ -14,6 +14,8 @@ tmpdir.refresh();
|
||||
const printA = require.resolve('../fixtures/printA.js');
|
||||
expect(`-r ${printA}`, 'A\nB\n');
|
||||
expect(`-r ${printA} -r ${printA}`, 'A\nB\n');
|
||||
expect(` -r ${printA} -r ${printA}`, 'A\nB\n');
|
||||
expect(` --require ${printA} --require ${printA}`, 'A\nB\n');
|
||||
expect('--no-deprecation', 'B\n');
|
||||
expect('--no-warnings', 'B\n');
|
||||
expect('--no_warnings', 'B\n');
|
||||
|
Loading…
x
Reference in New Issue
Block a user