11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled();
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
71cb0ef41Sopenharmony_ciconst startCLI = require('../common/debugger');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst assert = require('assert');
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ciconst cli = startCLI(['--port=0', fixtures.path('debugger/three-lines.js')]);
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci(async () => {
141cb0ef41Sopenharmony_ci  await cli.waitForInitialBreak();
151cb0ef41Sopenharmony_ci  await cli.waitForPrompt();
161cb0ef41Sopenharmony_ci  await cli.command('list(0)');
171cb0ef41Sopenharmony_ci  assert.match(cli.output, /> 1 let x = 1;/);
181cb0ef41Sopenharmony_ci  await cli.command('list(1)');
191cb0ef41Sopenharmony_ci  assert.match(cli.output, /> 1 let x = 1;\r?\n {2}2 x = x \+ 1;/);
201cb0ef41Sopenharmony_ci  await cli.command('list(10)');
211cb0ef41Sopenharmony_ci  assert.match(cli.output, /> 1 let x = 1;\r?\n {2}2 x = x \+ 1;\r?\n {2}3 module\.exports = x;\r?\n {2}4 /);
221cb0ef41Sopenharmony_ci  await cli.command('c');
231cb0ef41Sopenharmony_ci  await cli.waitFor(/disconnect/);
241cb0ef41Sopenharmony_ci  await cli.waitFor(/debug> $/);
251cb0ef41Sopenharmony_ci  await cli.command('list()');
261cb0ef41Sopenharmony_ci  await cli.waitFor(/ERR_DEBUGGER_ERROR/);
271cb0ef41Sopenharmony_ci  assert.match(cli.output, /Uncaught Error \[ERR_DEBUGGER_ERROR\]: Requires execution to be paused/);
281cb0ef41Sopenharmony_ci})()
291cb0ef41Sopenharmony_ci.finally(() => cli.quit())
301cb0ef41Sopenharmony_ci.then(common.mustCall());
31