From 927655cbc84517b8cf275d86a0b84dceb0cde651 Mon Sep 17 00:00:00 2001 From: Dmitry Cheryasov Date: Sat, 29 Jan 2011 15:17:44 +0200 Subject: [PATCH] String joiner fixes, tests. --- .../python/editor/PyJoinLinesHandler.java | 22 +++---- python/testData/joinLines/BinaryOp-after.py | 1 + python/testData/joinLines/BinaryOp.py | 2 + .../testData/joinLines/BinaryOpBelow-after.py | 1 + python/testData/joinLines/BinaryOpBelow.py | 2 + python/testData/joinLines/DictLCurly-after.py | 3 + python/testData/joinLines/DictLCurly.py | 4 ++ python/testData/joinLines/DictRCurly-after.py | 3 + python/testData/joinLines/DictRCurly.py | 4 ++ python/testData/joinLines/List-after.py | 1 + python/testData/joinLines/List.py | 2 + .../testData/joinLines/ListLBracket-after.py | 3 + python/testData/joinLines/ListLBracket.py | 4 ++ .../testData/joinLines/ListRBracket-after.py | 3 + python/testData/joinLines/ListRBracket.py | 4 ++ .../joinLines/StatementColon-after.py | 2 + python/testData/joinLines/StatementColon.py | 2 + .../joinLines/StatementComment-after.py | 1 + python/testData/joinLines/StatementComment.py | 2 + .../StatementCommentStatement-after.py | 2 + .../joinLines/StatementCommentStatement.py | 2 + .../StringDifferentOneQuotes-after.py | 1 + .../joinLines/StringDifferentOneQuotes.py | 2 + .../StringDifferentOneQuotesBelow-after.py | 1 + .../StringDifferentOneQuotesBelow.py | 2 + .../joinLines/StringOneQuoteEscEOL-after.py | 1 + .../joinLines/StringOneQuoteEscEOL.py | 2 + .../joinLines/StringOneQuotePlainRaw-after.py | 2 + .../joinLines/StringOneQuotePlainRaw.py | 2 + .../joinLines/StringOneQuotePlainU-after.py | 2 + .../joinLines/StringOneQuotePlainU.py | 2 + .../joinLines/StringTripleQuotes-after.py | 3 + .../testData/joinLines/StringTripleQuotes.py | 4 ++ .../StringTripleQuotesDifferent-after.py | 3 + .../joinLines/StringTripleQuotesDifferent.py | 3 + python/testData/joinLines/Tuple-after.py | 1 + python/testData/joinLines/Tuple.py | 2 + python/testData/joinLines/TupleLPar-after.py | 3 + python/testData/joinLines/TupleLPar.py | 4 ++ python/testData/joinLines/TupleRPar-after.py | 3 + python/testData/joinLines/TupleRPar.py | 4 ++ .../testData/joinLines/TwoStatements-after.py | 1 + python/testData/joinLines/TwoStatements.py | 2 + .../com/jetbrains/python/PyJoinLinesTest.java | 64 +++++++++++++++++++ 44 files changed, 173 insertions(+), 11 deletions(-) create mode 100644 python/testData/joinLines/BinaryOp-after.py create mode 100644 python/testData/joinLines/BinaryOp.py create mode 100644 python/testData/joinLines/BinaryOpBelow-after.py create mode 100644 python/testData/joinLines/BinaryOpBelow.py create mode 100644 python/testData/joinLines/DictLCurly-after.py create mode 100644 python/testData/joinLines/DictLCurly.py create mode 100644 python/testData/joinLines/DictRCurly-after.py create mode 100644 python/testData/joinLines/DictRCurly.py create mode 100644 python/testData/joinLines/List-after.py create mode 100644 python/testData/joinLines/List.py create mode 100644 python/testData/joinLines/ListLBracket-after.py create mode 100644 python/testData/joinLines/ListLBracket.py create mode 100644 python/testData/joinLines/ListRBracket-after.py create mode 100644 python/testData/joinLines/ListRBracket.py create mode 100644 python/testData/joinLines/StatementColon-after.py create mode 100644 python/testData/joinLines/StatementColon.py create mode 100644 python/testData/joinLines/StatementComment-after.py create mode 100644 python/testData/joinLines/StatementComment.py create mode 100644 python/testData/joinLines/StatementCommentStatement-after.py create mode 100644 python/testData/joinLines/StatementCommentStatement.py create mode 100644 python/testData/joinLines/StringDifferentOneQuotes-after.py create mode 100644 python/testData/joinLines/StringDifferentOneQuotes.py create mode 100644 python/testData/joinLines/StringDifferentOneQuotesBelow-after.py create mode 100644 python/testData/joinLines/StringDifferentOneQuotesBelow.py create mode 100644 python/testData/joinLines/StringOneQuoteEscEOL-after.py create mode 100644 python/testData/joinLines/StringOneQuoteEscEOL.py create mode 100644 python/testData/joinLines/StringOneQuotePlainRaw-after.py create mode 100644 python/testData/joinLines/StringOneQuotePlainRaw.py create mode 100644 python/testData/joinLines/StringOneQuotePlainU-after.py create mode 100644 python/testData/joinLines/StringOneQuotePlainU.py create mode 100644 python/testData/joinLines/StringTripleQuotes-after.py create mode 100644 python/testData/joinLines/StringTripleQuotes.py create mode 100644 python/testData/joinLines/StringTripleQuotesDifferent-after.py create mode 100644 python/testData/joinLines/StringTripleQuotesDifferent.py create mode 100644 python/testData/joinLines/Tuple-after.py create mode 100644 python/testData/joinLines/Tuple.py create mode 100644 python/testData/joinLines/TupleLPar-after.py create mode 100644 python/testData/joinLines/TupleLPar.py create mode 100644 python/testData/joinLines/TupleRPar-after.py create mode 100644 python/testData/joinLines/TupleRPar.py create mode 100644 python/testData/joinLines/TwoStatements-after.py create mode 100644 python/testData/joinLines/TwoStatements.py create mode 100644 python/testSrc/com/jetbrains/python/PyJoinLinesTest.java diff --git a/python/src/com/jetbrains/python/editor/PyJoinLinesHandler.java b/python/src/com/jetbrains/python/editor/PyJoinLinesHandler.java index 23d2b34b0868..48cea2df24f6 100644 --- a/python/src/com/jetbrains/python/editor/PyJoinLinesHandler.java +++ b/python/src/com/jetbrains/python/editor/PyJoinLinesHandler.java @@ -55,7 +55,7 @@ public class PyJoinLinesHandler implements JoinRawLinesHandlerDelegate { Joiner[] joiners = { // these are featherweight, will create and gc instantly new OpenBracketJoiner(), new CloseBracketJoiner(), - new StmtJoiner(), new StringLiteralJoiner(), + new StringLiteralJoiner(), new StmtJoiner(), // strings before stmts to let doc strings join new BinaryExprJoiner(), new ListLikeExprJoiner() }; @@ -243,8 +243,10 @@ public class PyJoinLinesHandler implements JoinRawLinesHandlerDelegate { public Result join(Request req) { if (req.leftElem() != req.rightElem()) { final PsiElement parent = req.rightElem().getParent(); - if (req.leftElem().getParent() == parent && parent instanceof PyStringLiteralExpression) { - // two quoted strings of same literal + if ((req.leftElem().getParent() == parent && parent instanceof PyStringLiteralExpression) || + (req.leftExpr() instanceof PyStringLiteralExpression && req.rightExpr() instanceof PyStringLiteralExpression) + ) { + // two quoted strings close by CharSequence text = req.document().getCharsSequence(); StrMod left_mod = new StrMod(text, req.leftElem().getTextRange()); StrMod right_mod = new StrMod(text, req.rightElem().getTextRange()); @@ -255,18 +257,16 @@ public class PyJoinLinesHandler implements JoinRawLinesHandlerDelegate { } else if (left_mod.compatibleTo(right_mod) && lquo.length() == 1 && right_mod.quote().length() == 1) { // maybe fit one literal's quotes to match other's - if (! containsChar(text, left_mod.getInnerRange(), right_mod.quote().charAt(0))) { + if (! containsChar(text, right_mod.getInnerRange(), left_mod.quote().charAt(0))) { + int quote_pos = right_mod.getInnerRange().getEndOffset(); + req.document().replaceString(quote_pos, quote_pos+1, left_mod.quote()); + return new Result("", 0, left_mod.quote().length(), right_mod.getStartPadding()); + } + else if (! containsChar(text, left_mod.getInnerRange(), right_mod.quote().charAt(0))) { int quote_pos = left_mod.getInnerRange().getStartOffset()-1; req.document().replaceString(quote_pos, quote_pos+1, right_mod.quote()); return new Result("", 0, left_mod.quote().length(), right_mod.getStartPadding()); } - else { - if (! containsChar(text, right_mod.getInnerRange(), left_mod.quote().charAt(0))) { - int quote_pos = right_mod.getInnerRange().getStartOffset()-1; - req.document().replaceString(quote_pos, quote_pos+1, left_mod.quote()); - return new Result("", 0, left_mod.quote().length(), right_mod.getStartPadding()); - } - } } } } diff --git a/python/testData/joinLines/BinaryOp-after.py b/python/testData/joinLines/BinaryOp-after.py new file mode 100644 index 000000000000..9769b591dbf7 --- /dev/null +++ b/python/testData/joinLines/BinaryOp-after.py @@ -0,0 +1 @@ +a = 1 + 2 diff --git a/python/testData/joinLines/BinaryOp.py b/python/testData/joinLines/BinaryOp.py new file mode 100644 index 000000000000..e7e9a7ba4b9d --- /dev/null +++ b/python/testData/joinLines/BinaryOp.py @@ -0,0 +1,2 @@ +a = 1 +\ + 2 diff --git a/python/testData/joinLines/BinaryOpBelow-after.py b/python/testData/joinLines/BinaryOpBelow-after.py new file mode 100644 index 000000000000..9769b591dbf7 --- /dev/null +++ b/python/testData/joinLines/BinaryOpBelow-after.py @@ -0,0 +1 @@ +a = 1 + 2 diff --git a/python/testData/joinLines/BinaryOpBelow.py b/python/testData/joinLines/BinaryOpBelow.py new file mode 100644 index 000000000000..3fd8282abcbe --- /dev/null +++ b/python/testData/joinLines/BinaryOpBelow.py @@ -0,0 +1,2 @@ +a = 1 \ + + 2 diff --git a/python/testData/joinLines/DictLCurly-after.py b/python/testData/joinLines/DictLCurly-after.py new file mode 100644 index 000000000000..1dc6c1e1c39e --- /dev/null +++ b/python/testData/joinLines/DictLCurly-after.py @@ -0,0 +1,3 @@ +a = {'a': 1, + 'b': 2 +} diff --git a/python/testData/joinLines/DictLCurly.py b/python/testData/joinLines/DictLCurly.py new file mode 100644 index 000000000000..53618d8863cd --- /dev/null +++ b/python/testData/joinLines/DictLCurly.py @@ -0,0 +1,4 @@ +a = { + 'a': 1, + 'b': 2 +} diff --git a/python/testData/joinLines/DictRCurly-after.py b/python/testData/joinLines/DictRCurly-after.py new file mode 100644 index 000000000000..a2c9610ab61a --- /dev/null +++ b/python/testData/joinLines/DictRCurly-after.py @@ -0,0 +1,3 @@ +a = { + 'a': 1, + 'b': 2} diff --git a/python/testData/joinLines/DictRCurly.py b/python/testData/joinLines/DictRCurly.py new file mode 100644 index 000000000000..ea7e5779dab2 --- /dev/null +++ b/python/testData/joinLines/DictRCurly.py @@ -0,0 +1,4 @@ +a = { + 'a': 1, + 'b': 2 +} diff --git a/python/testData/joinLines/List-after.py b/python/testData/joinLines/List-after.py new file mode 100644 index 000000000000..fd76cb742554 --- /dev/null +++ b/python/testData/joinLines/List-after.py @@ -0,0 +1 @@ +a = [1, 2] diff --git a/python/testData/joinLines/List.py b/python/testData/joinLines/List.py new file mode 100644 index 000000000000..6c1338d46caf --- /dev/null +++ b/python/testData/joinLines/List.py @@ -0,0 +1,2 @@ +a = [1, + 2] diff --git a/python/testData/joinLines/ListLBracket-after.py b/python/testData/joinLines/ListLBracket-after.py new file mode 100644 index 000000000000..eb6a9faed3ea --- /dev/null +++ b/python/testData/joinLines/ListLBracket-after.py @@ -0,0 +1,3 @@ +a = [111, + 222 +] diff --git a/python/testData/joinLines/ListLBracket.py b/python/testData/joinLines/ListLBracket.py new file mode 100644 index 000000000000..6d491c3ff229 --- /dev/null +++ b/python/testData/joinLines/ListLBracket.py @@ -0,0 +1,4 @@ +a = [ + 111, + 222 +] diff --git a/python/testData/joinLines/ListRBracket-after.py b/python/testData/joinLines/ListRBracket-after.py new file mode 100644 index 000000000000..0c5436e5b185 --- /dev/null +++ b/python/testData/joinLines/ListRBracket-after.py @@ -0,0 +1,3 @@ +a = [ + 111, + 222] diff --git a/python/testData/joinLines/ListRBracket.py b/python/testData/joinLines/ListRBracket.py new file mode 100644 index 000000000000..79f401fd69eb --- /dev/null +++ b/python/testData/joinLines/ListRBracket.py @@ -0,0 +1,4 @@ +a = [ + 111, + 222 +] diff --git a/python/testData/joinLines/StatementColon-after.py b/python/testData/joinLines/StatementColon-after.py new file mode 100644 index 000000000000..f24e21a96770 --- /dev/null +++ b/python/testData/joinLines/StatementColon-after.py @@ -0,0 +1,2 @@ +if True: + return "No special handling" diff --git a/python/testData/joinLines/StatementColon.py b/python/testData/joinLines/StatementColon.py new file mode 100644 index 000000000000..f24e21a96770 --- /dev/null +++ b/python/testData/joinLines/StatementColon.py @@ -0,0 +1,2 @@ +if True: + return "No special handling" diff --git a/python/testData/joinLines/StatementComment-after.py b/python/testData/joinLines/StatementComment-after.py new file mode 100644 index 000000000000..064365873c2d --- /dev/null +++ b/python/testData/joinLines/StatementComment-after.py @@ -0,0 +1 @@ +a = 1; b = 2 # a note about b diff --git a/python/testData/joinLines/StatementComment.py b/python/testData/joinLines/StatementComment.py new file mode 100644 index 000000000000..3965f6dc8c2a --- /dev/null +++ b/python/testData/joinLines/StatementComment.py @@ -0,0 +1,2 @@ +a = 1 +b = 2 # a note about b diff --git a/python/testData/joinLines/StatementCommentStatement-after.py b/python/testData/joinLines/StatementCommentStatement-after.py new file mode 100644 index 000000000000..f7f12f8a4499 --- /dev/null +++ b/python/testData/joinLines/StatementCommentStatement-after.py @@ -0,0 +1,2 @@ +a = 1 # surprise! +b = 2 diff --git a/python/testData/joinLines/StatementCommentStatement.py b/python/testData/joinLines/StatementCommentStatement.py new file mode 100644 index 000000000000..c7de251ad689 --- /dev/null +++ b/python/testData/joinLines/StatementCommentStatement.py @@ -0,0 +1,2 @@ +a = 1 # surprise! +b = 2 diff --git a/python/testData/joinLines/StringDifferentOneQuotes-after.py b/python/testData/joinLines/StringDifferentOneQuotes-after.py new file mode 100644 index 000000000000..8ee2d265b499 --- /dev/null +++ b/python/testData/joinLines/StringDifferentOneQuotes-after.py @@ -0,0 +1 @@ +a = (u'A single quote is never found in this literal') diff --git a/python/testData/joinLines/StringDifferentOneQuotes.py b/python/testData/joinLines/StringDifferentOneQuotes.py new file mode 100644 index 000000000000..538c43aada1d --- /dev/null +++ b/python/testData/joinLines/StringDifferentOneQuotes.py @@ -0,0 +1,2 @@ +a = (u'A single quote ' + u"is never found in this literal") diff --git a/python/testData/joinLines/StringDifferentOneQuotesBelow-after.py b/python/testData/joinLines/StringDifferentOneQuotesBelow-after.py new file mode 100644 index 000000000000..998a05108a00 --- /dev/null +++ b/python/testData/joinLines/StringDifferentOneQuotesBelow-after.py @@ -0,0 +1 @@ +a = (u"A single quote is this literal's hallmark") diff --git a/python/testData/joinLines/StringDifferentOneQuotesBelow.py b/python/testData/joinLines/StringDifferentOneQuotesBelow.py new file mode 100644 index 000000000000..b5a8e754a18f --- /dev/null +++ b/python/testData/joinLines/StringDifferentOneQuotesBelow.py @@ -0,0 +1,2 @@ +a = (u'A single quote ' + u"is this literal's hallmark") diff --git a/python/testData/joinLines/StringOneQuoteEscEOL-after.py b/python/testData/joinLines/StringOneQuoteEscEOL-after.py new file mode 100644 index 000000000000..9eee636afd0f --- /dev/null +++ b/python/testData/joinLines/StringOneQuoteEscEOL-after.py @@ -0,0 +1 @@ +a = "aaaaABbbbb" diff --git a/python/testData/joinLines/StringOneQuoteEscEOL.py b/python/testData/joinLines/StringOneQuoteEscEOL.py new file mode 100644 index 000000000000..68c256625067 --- /dev/null +++ b/python/testData/joinLines/StringOneQuoteEscEOL.py @@ -0,0 +1,2 @@ +a = "aaaaA"\ + "Bbbbb" diff --git a/python/testData/joinLines/StringOneQuotePlainRaw-after.py b/python/testData/joinLines/StringOneQuotePlainRaw-after.py new file mode 100644 index 000000000000..b25c96d6cf30 --- /dev/null +++ b/python/testData/joinLines/StringOneQuotePlainRaw-after.py @@ -0,0 +1,2 @@ +print (r"See, \n separates two lines: " + "this and\nthe other") diff --git a/python/testData/joinLines/StringOneQuotePlainRaw.py b/python/testData/joinLines/StringOneQuotePlainRaw.py new file mode 100644 index 000000000000..3e2c1076a952 --- /dev/null +++ b/python/testData/joinLines/StringOneQuotePlainRaw.py @@ -0,0 +1,2 @@ +print (r"See, \n separates two lines: " + "this and\nthe other") diff --git a/python/testData/joinLines/StringOneQuotePlainU-after.py b/python/testData/joinLines/StringOneQuotePlainU-after.py new file mode 100644 index 000000000000..52a8d45e4d46 --- /dev/null +++ b/python/testData/joinLines/StringOneQuotePlainU-after.py @@ -0,0 +1,2 @@ +a = (u"Ein Deutsche Text. " + "An English text") diff --git a/python/testData/joinLines/StringOneQuotePlainU.py b/python/testData/joinLines/StringOneQuotePlainU.py new file mode 100644 index 000000000000..7b90b5304a2d --- /dev/null +++ b/python/testData/joinLines/StringOneQuotePlainU.py @@ -0,0 +1,2 @@ +a = (u"Ein Deutsche Text. " + "An English text") diff --git a/python/testData/joinLines/StringTripleQuotes-after.py b/python/testData/joinLines/StringTripleQuotes-after.py new file mode 100644 index 000000000000..3a15cad87835 --- /dev/null +++ b/python/testData/joinLines/StringTripleQuotes-after.py @@ -0,0 +1,3 @@ +"""This doc comment +needs to be joined +with the one below""" diff --git a/python/testData/joinLines/StringTripleQuotes.py b/python/testData/joinLines/StringTripleQuotes.py new file mode 100644 index 000000000000..0c565286d367 --- /dev/null +++ b/python/testData/joinLines/StringTripleQuotes.py @@ -0,0 +1,4 @@ +"""This doc comment +needs to """ +"""be joined +with the one below""" diff --git a/python/testData/joinLines/StringTripleQuotesDifferent-after.py b/python/testData/joinLines/StringTripleQuotesDifferent-after.py new file mode 100644 index 000000000000..8adc69904a41 --- /dev/null +++ b/python/testData/joinLines/StringTripleQuotesDifferent-after.py @@ -0,0 +1,3 @@ +'''This doc comment +is quite separate''' +"""from the literal below""" diff --git a/python/testData/joinLines/StringTripleQuotesDifferent.py b/python/testData/joinLines/StringTripleQuotesDifferent.py new file mode 100644 index 000000000000..8adc69904a41 --- /dev/null +++ b/python/testData/joinLines/StringTripleQuotesDifferent.py @@ -0,0 +1,3 @@ +'''This doc comment +is quite separate''' +"""from the literal below""" diff --git a/python/testData/joinLines/Tuple-after.py b/python/testData/joinLines/Tuple-after.py new file mode 100644 index 000000000000..4241e0dd844b --- /dev/null +++ b/python/testData/joinLines/Tuple-after.py @@ -0,0 +1 @@ +a = (1, 2) diff --git a/python/testData/joinLines/Tuple.py b/python/testData/joinLines/Tuple.py new file mode 100644 index 000000000000..c3363449df66 --- /dev/null +++ b/python/testData/joinLines/Tuple.py @@ -0,0 +1,2 @@ +a = (1, + 2) diff --git a/python/testData/joinLines/TupleLPar-after.py b/python/testData/joinLines/TupleLPar-after.py new file mode 100644 index 000000000000..fa697b763f27 --- /dev/null +++ b/python/testData/joinLines/TupleLPar-after.py @@ -0,0 +1,3 @@ +a = (1, + 2 +) diff --git a/python/testData/joinLines/TupleLPar.py b/python/testData/joinLines/TupleLPar.py new file mode 100644 index 000000000000..4fa1cb49fb6c --- /dev/null +++ b/python/testData/joinLines/TupleLPar.py @@ -0,0 +1,4 @@ +a = ( + 1, + 2 +) diff --git a/python/testData/joinLines/TupleRPar-after.py b/python/testData/joinLines/TupleRPar-after.py new file mode 100644 index 000000000000..693200124a0b --- /dev/null +++ b/python/testData/joinLines/TupleRPar-after.py @@ -0,0 +1,3 @@ +a = ( + 1, + 2,) diff --git a/python/testData/joinLines/TupleRPar.py b/python/testData/joinLines/TupleRPar.py new file mode 100644 index 000000000000..20eebe9835a5 --- /dev/null +++ b/python/testData/joinLines/TupleRPar.py @@ -0,0 +1,4 @@ +a = ( + 1, + 2, +) diff --git a/python/testData/joinLines/TwoStatements-after.py b/python/testData/joinLines/TwoStatements-after.py new file mode 100644 index 000000000000..fc068ca4203c --- /dev/null +++ b/python/testData/joinLines/TwoStatements-after.py @@ -0,0 +1 @@ +a = 1; b = 2 diff --git a/python/testData/joinLines/TwoStatements.py b/python/testData/joinLines/TwoStatements.py new file mode 100644 index 000000000000..f32b2eb57761 --- /dev/null +++ b/python/testData/joinLines/TwoStatements.py @@ -0,0 +1,2 @@ +a = 1 +b = 2 diff --git a/python/testSrc/com/jetbrains/python/PyJoinLinesTest.java b/python/testSrc/com/jetbrains/python/PyJoinLinesTest.java new file mode 100644 index 000000000000..5e1ceb548923 --- /dev/null +++ b/python/testSrc/com/jetbrains/python/PyJoinLinesTest.java @@ -0,0 +1,64 @@ +package com.jetbrains.python; + +import com.intellij.codeInsight.editorActions.JoinRawLinesHandlerDelegate; +import com.intellij.openapi.application.Result; +import com.intellij.openapi.application.WriteAction; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.Editor; +import com.jetbrains.python.editor.PyJoinLinesHandler; +import com.jetbrains.python.fixtures.PyLightFixtureTestCase; + +/** + * Tests the "Join lines" handler. + *
+ * User: dcheryasov + * Date: 1/29/11 2:33 AM + */ +public class PyJoinLinesTest extends PyLightFixtureTestCase { + private void doTest() { + final String path = "joinLines/"; + myFixture.configureByFile(path + getTestName(false) + ".py"); + // detect whitespace around EOL, the way JoinLinesHandler does. + final Editor editor = myFixture.getEditor(); + final Document doc = editor.getDocument(); + final int caret_line = doc.getLineNumber(editor.getCaretModel().getOffset()); + final int eol_pos = doc.getLineEndOffset(caret_line); + CharSequence text = doc.getCharsSequence(); + int i = eol_pos; + while (" \n\t".indexOf(text.charAt(i)) >= 0) i -= 1; + final int start = i+1; + i = eol_pos; + while (" \n\t".indexOf(text.charAt(i)) >= 0) i += 1; + final int end = i; + final JoinRawLinesHandlerDelegate handler = new PyJoinLinesHandler(); + new WriteAction() { + @Override + protected void run(Result result) throws Throwable { + int ret = handler.tryJoinRawLines(doc, myFixture.getFile(), start, end); + } + }.execute().throwException(); + myFixture.checkResultByFile(path + getTestName(false) + "-after.py"); + } + + public void testBinaryOpBelow() { doTest(); } + public void testBinaryOp() { doTest(); } + public void testDictLCurly() { doTest(); } + public void testDictRCurly() { doTest(); } + public void testListLBracket() { doTest(); } + public void testList() { doTest(); } + public void testListRBracket() { doTest(); } + public void testStatementColon() { doTest(); } + public void testStatementComment() { doTest(); } + public void testStatementCommentStatement() { doTest(); } + public void testStringDifferentOneQuotes() { doTest(); } + public void testStringDifferentOneQuotesBelow() { doTest(); } + public void testStringOneQuoteEscEOL() { doTest(); } + public void testStringOneQuotePlainRaw() { doTest(); } + public void testStringOneQuotePlainU() { doTest(); } + public void testStringTripleQuotesDifferent() { doTest(); } + public void testStringTripleQuotes() { doTest(); } + public void testTupleLPar() { doTest(); } + public void testTuple() { doTest(); } + public void testTupleRPar() { doTest(); } + public void testTwoStatements() { doTest(); } +}