Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert the test case which has been failing due to auto-indent feature #1673

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 34 additions & 32 deletions src/test/suite/commands/kill-yank/kill-ring-yank.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
assertTextEqual,
cleanUpWorkspace,
clearTextEditor,
delay,
setEmptyCursors,
setupWorkspace,
} from "../../utils";
Expand Down Expand Up @@ -515,47 +516,48 @@ ABCDEFGHIJ`,
});
});

// NOTE: This test suite has been commented out due to https://github.com/whitphx/vscode-emacs-mcx/issues/1249
// TODO: Fix the problem and enable this test suite again.
// suite("yank pop with auto-indent", () => {
// let activeTextEditor: vscode.TextEditor;
suite("yank pop with auto-indent", () => {
let activeTextEditor: vscode.TextEditor;

// teardown(cleanUpWorkspace);
teardown(cleanUpWorkspace);

// test("Yank in a language that has auto-indent support", async function () {
// activeTextEditor = await setupWorkspace("", { language: "typescript" });
// activeTextEditor.options.tabSize = 4;
test("Yank in a language that has auto-indent support", async function () {
activeTextEditor = await setupWorkspace("", { language: "typescript" });
activeTextEditor.options.tabSize = 4;

// const killRing = new KillRing(60);
// const emulator = new EmacsEmulator(activeTextEditor, killRing);
const killRing = new KillRing(60);
const emulator = new EmacsEmulator(activeTextEditor, killRing);

// // Kill texts
// await clearTextEditor(activeTextEditor, "foo"); // No indent
// await vscode.commands.executeCommand("editor.action.selectAll");
// await emulator.runCommand("killRegion");
// Kill texts
await clearTextEditor(activeTextEditor, "foo"); // No indent
await vscode.commands.executeCommand("editor.action.selectAll");
await emulator.runCommand("killRegion");

// await clearTextEditor(activeTextEditor, "bar"); // No indent
// await vscode.commands.executeCommand("editor.action.selectAll");
// await emulator.runCommand("killRegion");
await clearTextEditor(activeTextEditor, "bar"); // No indent
await vscode.commands.executeCommand("editor.action.selectAll");
await emulator.runCommand("killRegion");

// // Initialize with parentheses, that triggers auto-indent to inner text
// const initialText = "{\n\n}";
// await clearTextEditor(activeTextEditor, initialText);
// setEmptyCursors(activeTextEditor, [1, 0]);
// Initialize with parentheses, that triggers auto-indent to inner text
const initialText = "{\n\n}";
await clearTextEditor(activeTextEditor, initialText);
setEmptyCursors(activeTextEditor, [1, 0]);

// // Yank pastes "bar" with auto-indentation
// await emulator.runCommand("yank");
// assertTextEqual(activeTextEditor, "{\n bar\n}");
// Yank pastes "bar" with auto-indentation
await emulator.runCommand("yank");
await delay(10);
assertTextEqual(activeTextEditor, "{\n bar\n}");

// // YankPop pastes "foo" with auto-indentation
// await emulator.runCommand("yankPop");
// assertTextEqual(activeTextEditor, "{\n foo\n}");
// YankPop pastes "foo" with auto-indentation
await emulator.runCommand("yankPop");
await delay(10);
assertTextEqual(activeTextEditor, "{\n foo\n}");

// // yankPop again
// await emulator.runCommand("yankPop");
// assertTextEqual(activeTextEditor, "{\n bar\n}");
// });
// });
// yankPop again
await emulator.runCommand("yankPop");
await delay(10);
assertTextEqual(activeTextEditor, "{\n bar\n}");
});
});

suite("Kill and yank with multi cursor, killing at 2 cursors in different lines", () => {
let activeTextEditor: vscode.TextEditor;
Expand Down
Loading