Changeset View
Changeset View
Standalone View
Standalone View
autotests/src/katedocument_test.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 304 | { | |||
---|---|---|---|---|---|
353 | reset(); | 353 | reset(); | ||
354 | testInput = ("foo \"bar\" haz"); | 354 | testInput = ("foo \"bar\" haz"); | ||
355 | typeText(testInput); | 355 | typeText(testInput); | ||
356 | QCOMPARE(doc.text(), testInput); | 356 | QCOMPARE(doc.text(), testInput); | ||
357 | // Simulate afterwards to add quotes, bug 405089 | 357 | // Simulate afterwards to add quotes, bug 405089 | ||
358 | doc.setText("foo \"bar"); | 358 | doc.setText("foo \"bar"); | ||
359 | typeText("\" haz"); | 359 | typeText("\" haz"); | ||
360 | QCOMPARE(doc.text(), testInput); | 360 | QCOMPARE(doc.text(), testInput); | ||
361 | | ||||
362 | // Let's check to add brackets to a selection... | ||||
363 | view->setBlockSelection(false); | ||||
364 | doc.setText("012xxx678"); | ||||
365 | view->setSelection(Range(0, 3, 0, 6)); | ||||
366 | typeText("["); | ||||
367 | QCOMPARE(doc.text(), "012[xxx]678"); | ||||
368 | | ||||
369 | // ...over multiple lines.. | ||||
370 | doc.setText("012xxx678\n012xxx678"); | ||||
371 | view->setSelection(Range(0, 3, 1, 6)); | ||||
372 | typeText("["); | ||||
373 | QCOMPARE(doc.text(), "012[xxx678\n012xxx]678"); | ||||
374 | | ||||
375 | // ..once again in in block mode | ||||
376 | view->setBlockSelection(true); | ||||
377 | doc.setText("012xxx678\n012xxx678"); | ||||
378 | view->setSelection(Range(0, 3, 1, 6)); | ||||
379 | typeText("["); | ||||
380 | QCOMPARE(doc.text(), "012[xxx]678\n012[xxx]678"); | ||||
361 | } | 381 | } | ||
362 | 382 | | |||
363 | void KateDocumentTest::testReplaceTabs() | 383 | void KateDocumentTest::testReplaceTabs() | ||
364 | { | 384 | { | ||
365 | KTextEditor::DocumentPrivate doc; | 385 | KTextEditor::DocumentPrivate doc; | ||
366 | auto view = static_cast<KTextEditor::ViewPrivate*>(doc.createView(nullptr)); | 386 | auto view = static_cast<KTextEditor::ViewPrivate*>(doc.createView(nullptr)); | ||
367 | 387 | | |||
368 | auto reset = [&]() { | 388 | auto reset = [&]() { | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |