-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from intuit/master
Merge into my fork
- Loading branch information
Showing
13 changed files
with
39 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import com.intellij.testFramework.fixtures.BasePlatformTestCase | ||
|
||
/** | ||
* Base test case for the DockDockBuild tests using fixtures. | ||
*/ | ||
abstract class DockDockTestCase : BasePlatformTestCase() { | ||
final override fun getTestDataPath() = "testData" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase | ||
|
||
class MakefileCompletionTest : LightPlatformCodeInsightFixtureTestCase() { | ||
class MakefileCompletionTest : DockDockTestCase() { | ||
fun testSimple() = doTest("b", "c", "d", "${getTestName(true)}.mk") | ||
fun testTargets() = doTest("a", "${getTestName(true)}.mk") | ||
|
||
fun doTest(vararg variants: String) = myFixture.testCompletionVariants("$testDataPath/$basePath/${getTestName(true)}.mk", *variants) | ||
fun doTest(vararg variants: String) = myFixture.testCompletionVariants("$basePath/${getTestName(true)}.mk", *variants) | ||
|
||
override fun getTestDataPath() = "testData" | ||
override fun getBasePath() = "completion" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase | ||
|
||
class MakefileCreateRuleQuickfixTest : LightPlatformCodeInsightFixtureTestCase() { | ||
class MakefileCreateRuleQuickfixTest : DockDockTestCase() { | ||
fun testSimple() = doTest() | ||
fun testMiddle() = doTest() | ||
|
||
|
||
fun doTest() { | ||
myFixture.configureByFile("$testDataPath/$basePath/${getTestName(true)}.mk") | ||
myFixture.configureByFile("$basePath/${getTestName(true)}.mk") | ||
val intention = myFixture.findSingleIntention("Create Rule") | ||
myFixture.launchAction(intention) | ||
myFixture.checkResultByFile("$basePath/${getTestName(true)}.gold.mk") | ||
} | ||
|
||
override fun getTestDataPath() = "testData" | ||
override fun getBasePath() = "quickfix/createRule" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase | ||
|
||
class MakefileFoldingTest : LightPlatformCodeInsightFixtureTestCase() { | ||
class MakefileFoldingTest : DockDockTestCase() { | ||
fun testRule() = doTest() | ||
fun testVariable() = doTest() | ||
fun testDefine() = doTest() | ||
|
||
|
||
fun doTest() = myFixture.testFolding("$testDataPath/$basePath/${getTestName(true)}.mk") | ||
|
||
override fun getTestDataPath() = "testData" | ||
override fun getBasePath() = "folding" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase | ||
|
||
class MakefileHighlightingTest : LightPlatformCodeInsightFixtureTestCase() { | ||
class MakefileHighlightingTest : DockDockTestCase() { | ||
fun testUnresolved() = doTest() | ||
fun testRedundant() = doTest(true) | ||
fun testTargetspecificvars() = doTest() | ||
|
||
fun doTest(checkInfos: Boolean = false) { myFixture.testHighlighting(true, checkInfos, true, "$testDataPath/$basePath/${getTestName(true)}.mk") } | ||
fun doTest(checkInfos: Boolean = false) { | ||
myFixture.testHighlighting(true, checkInfos, true, | ||
"$basePath/${getTestName(true)}.mk") | ||
} | ||
|
||
override fun getTestDataPath() = "testData" | ||
override fun getBasePath() = "highlighting" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase | ||
|
||
class MakefileRemoveRuleQuickfixTest : LightPlatformCodeInsightFixtureTestCase() { | ||
class MakefileRemoveRuleQuickfixTest : DockDockTestCase() { | ||
fun testSingle() = doTest() | ||
fun testTwo() = doTest() | ||
|
||
fun doTest() { | ||
myFixture.configureByFile("$testDataPath/$basePath/${getTestName(true)}.mk") | ||
myFixture.configureByFile("$basePath/${getTestName(true)}.mk") | ||
val intention = myFixture.findSingleIntention("Remove Empty Rule") | ||
myFixture.launchAction(intention) | ||
myFixture.checkResultByFile("$basePath/${getTestName(true)}.gold.mk") | ||
} | ||
|
||
override fun getTestDataPath() = "testData" | ||
override fun getBasePath() = "quickfix/removeRule" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import com.intellij.testFramework.* | ||
import com.intellij.testFramework.fixtures.* | ||
import com.intellij.testFramework.PlatformTestUtil | ||
|
||
class MakefileStructureViewTest : LightPlatformCodeInsightFixtureTestCase() { | ||
class MakefileStructureViewTest : DockDockTestCase() { | ||
fun testSimple() { | ||
val filename = "${getTestName(true)}.mk" | ||
myFixture.configureByFile("$testDataPath/$basePath/$filename") | ||
myFixture.configureByFile("$basePath/$filename") | ||
myFixture.testStructureView { | ||
PlatformTestUtil.expandAll(it.tree) | ||
PlatformTestUtil.assertTreeEqual(it.tree, "-simple.mk\n all\n hello\n world\n") | ||
} | ||
} | ||
|
||
override fun getTestDataPath() = "testData" | ||
override fun getBasePath() = "structure" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase | ||
|
||
class MakefileTargetRenameTest : LightPlatformCodeInsightFixtureTestCase() { | ||
class MakefileTargetRenameTest : DockDockTestCase() { | ||
fun testSimple() = doTest("qwerty") | ||
|
||
|
||
fun doTest(newName: String) { | ||
myFixture.configureByFile("$testDataPath/$basePath/${getTestName(true)}.mk") | ||
myFixture.configureByFile("$basePath/${getTestName(true)}.mk") | ||
myFixture.renameElementAtCaret(newName) | ||
myFixture.checkResultByFile("$basePath/${getTestName(true)}.gold.mk") | ||
} | ||
|
||
override fun getTestDataPath() = "testData" | ||
override fun getBasePath() = "rename" | ||
} |