mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
pass test
This commit is contained in:
parent
4540b9ba1f
commit
3b6848c4e6
|
@ -37,8 +37,7 @@ const cellRegex = /(Cell\s+(?:\u001b\[.+?m)?In\s*\[(\d+)\])(,\s*line \d+)/;
|
|||
const inputRegex = /(Input\s+?(?:\u001b\[.+?m)In\s*\[(\d+)\])(.*?)/;
|
||||
|
||||
function isIpythonStackTrace(stack: string) {
|
||||
// at least one group will point to the Cell within the notebook
|
||||
return cellRegex.test(stack);
|
||||
return cellRegex.test(stack) || inputRegex.test(stack) || fileRegex.test(stack);
|
||||
}
|
||||
|
||||
function stripFormatting(text: string) {
|
||||
|
|
|
@ -46,9 +46,8 @@ suite('StackTraceHelper', () => {
|
|||
'\u001b[1;32m----> 2\u001b[0m \u001b[43mmyLib\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mthrowEx\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n';
|
||||
|
||||
const formatted = formatStackTrace(stack);
|
||||
assert.ok(formatted.indexOf('<a href=\'vscode-notebook-cell:?execution=3\'>Input [2]</a>') > 0, formatted);
|
||||
assert.ok(formatted.indexOf('<a href=\'vscode-notebook-cell:?execution=3:2\'>2</a>') > 0, formatted);
|
||||
assert.ok(formatted.indexOf('<a href=\'C:\\venvs\\myLib.py:2\'>2</a>') > 0, formatted);
|
||||
assert.ok(formatted.indexOf('<a href=\'vscode-notebook-cell:?execution=2\'>Input In [2]</a>') > 0, formatted);
|
||||
assert.ok(formatted.indexOf('<a href=\'vscode-notebook-cell:?execution=2:2\'>2</a>') > 0, formatted);
|
||||
});
|
||||
|
||||
test('IPython stack trace lines without associated location are not linkified', () => {
|
||||
|
|
Loading…
Reference in a new issue