當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript DebugClient.assertStoppedLocation方法代碼示例

本文整理匯總了TypeScript中vscode-debugadapter-testsupport.DebugClient.assertStoppedLocation方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DebugClient.assertStoppedLocation方法的具體用法?TypeScript DebugClient.assertStoppedLocation怎麽用?TypeScript DebugClient.assertStoppedLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vscode-debugadapter-testsupport.DebugClient的用法示例。


在下文中一共展示了DebugClient.assertStoppedLocation方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: test

		test('should stop on a conditional breakpoint', () => {

			const PROGRAM = Path.join(DATA_ROOT, 'program.js');
			const COND_BREAKPOINT_LINE = 13;
			const COND_BREAKPOINT_COLUMN = 2;

			return Promise.all([

				dc.waitForEvent('initialized').then(event => {
					return dc.setBreakpointsRequest({
						breakpoints: [ { line: COND_BREAKPOINT_LINE, condition: 'i === 3' } ],
						source: { path: PROGRAM }
					});
				}).then(response => {
					const bp = response.body.breakpoints[0];
					assert.equal(bp.verified, true, 'breakpoint verification mismatch: verified');
					assert.equal(bp.line, COND_BREAKPOINT_LINE, 'breakpoint verification mismatch: line');
					assert.equal(bp.column, COND_BREAKPOINT_COLUMN, 'breakpoint verification mismatch: column');
					return dc.configurationDoneRequest();
				}),

				dc.launch({ program: PROGRAM }),

				dc.assertStoppedLocation('breakpoint', { path: PROGRAM, line: COND_BREAKPOINT_LINE } ).then(response => {
					const frame = response.body.stackFrames[0];
					return dc.evaluateRequest({ context: 'watch', frameId: frame.id, expression: 'x' }).then(response => {
						assert.equal(response.body.result, 9, 'x !== 9');
						return response;
					});
				})
			]);
		});
開發者ID:abug,項目名稱:vscode-node-debug,代碼行數:32,代碼來源:adapter.test.ts

示例2: test

test('should stop on entry', () => {
    return Promise.all([
        dc.configurationSequence(),
        dc.launch({ program: 'tests/out/debuggee', stopOnEntry: true }),
        dc.assertStoppedLocation('signal', { path: null, line: null, column: null })
    ]);
});
開發者ID:magpier84,項目名稱:vscode-lldb,代碼行數:7,代碼來源:adapter.test.ts

示例3: test

		test('should stop on debugger statement', () => {

			const PROGRAM = Path.join(DATA_ROOT, 'simple_break/Program.exe');
			const DEBUGGER_LINE = 10;

			return Promise.all([
				dc.configurationSequence(),
				dc.launch({ program: PROGRAM }),
				dc.assertStoppedLocation('step', DEBUGGER_LINE)
			]);
		});
開發者ID:jason1978nian,項目名稱:vscode-mono-debug,代碼行數:11,代碼來源:adapter.test.ts

示例4: test

		test('should stop on an exception', () => {

			const PROGRAM_WITH_EXCEPTION = Path.join(DATA_ROOT, 'testWithException.md');
			const EXCEPTION_LINE = 4;

			return Promise.all([

				dc.waitForEvent('initialized').then(event => {
					return dc.setExceptionBreakpointsRequest({
						filters: [ 'all' ]
					});
				}).then(response => {
					return dc.configurationDoneRequest();
				}),

				dc.launch({ program: PROGRAM_WITH_EXCEPTION }),

				dc.assertStoppedLocation('exception', { line: EXCEPTION_LINE } )
			]);
		});
開發者ID:rlugojr,項目名稱:vscode-mock-debug,代碼行數:20,代碼來源:adapter.test.ts

示例5: test

		test('should get correct variables on a breakpoint', done => {
			const PROGRAM = Path.join(DATA_ROOT, 'basic.rb');
			const BREAKPOINT_LINE = 3;

			return Promise.all([
				dc.hitBreakpoint(
					{ program: PROGRAM },
					{ path: PROGRAM, line: BREAKPOINT_LINE }
				),
				dc.assertStoppedLocation(
					'breakpoint',
					{ line: BREAKPOINT_LINE }
					).then(response => {
						return dc.scopesRequest({
							frameId: response.body.stackFrames[0].id
						})
					}).then(response => {
						return dc.variablesRequest({
							variablesReference: response.body.scopes[0].variablesReference
						});
					}).then(response => {
						assert.equal(response.body.variables.length, 3);
						assert.equal(response.body.variables[0].name, "a");
						assert.equal(response.body.variables[0].value, "10");
						assert.equal(response.body.variables[1].name, "b");
						assert.equal(response.body.variables[1].value, "undefined");
						assert.equal(response.body.variables[2].name, "c");
						assert.equal(response.body.variables[2].value, "undefined");
						dc.disconnectRequest({});
						done();
					})
					.catch(err => {
						// error expected
						dc.disconnectRequest({});
						done(new Error(err));
					})
			]);
		})
開發者ID:karuna,項目名稱:vscode-ruby,代碼行數:38,代碼來源:adapter.test.ts


注:本文中的vscode-debugadapter-testsupport.DebugClient.assertStoppedLocation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。