-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix proof search and intention tests
- Loading branch information
1 parent
17f11a4
commit 70766d3
Showing
4 changed files
with
51 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.arend.intention | ||
|
||
import org.arend.quickfix.QuickFixTestBase | ||
import org.arend.util.ArendBundle | ||
|
||
class BaseIntentionTest : QuickFixTestBase() { | ||
fun `test wrap in goal with the end marker`() { | ||
configure(""" | ||
\data List | ||
| nil | ||
| cons Nat List | ||
\func plus (a b : Prelude.Nat) => a Nat.+ b | ||
\func lol => {-selection-}cons (plus 2 3) (cons (plus 2 3) nil){-caret-}{-end_selection-} | ||
""") | ||
assertNotNull(myFixture.findSingleIntention(ArendBundle.message("arend.expression.wrapInGoal"))) | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
src/test/kotlin/org/arend/search/ArendProofSearchInsertTest.kt
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,31 @@ | ||
package org.arend.search | ||
|
||
import org.arend.ArendTestBase | ||
import org.arend.fileTreeFromText | ||
import org.arend.search.proof.ProofSearchUI.Companion.insertDefinition | ||
import org.arend.search.proof.generateProofSearchResults | ||
|
||
class ArendProofSearchInsertTest : ArendTestBase() { | ||
fun testCheckInsert() { | ||
val result = fileTreeFromText(""" | ||
\data Bool | ||
\func foo : Nat -> Bool => {?} | ||
\func lol => {-caret-} | ||
""".trimIndent()) | ||
result.createAndOpenFileWithCaretMarker() | ||
val caret = myFixture.editor.caretModel.currentCaret | ||
|
||
typecheck() | ||
val results = generateProofSearchResults(project, "Nat").filterNotNull().toList() | ||
assertTrue(results.size == 1) | ||
|
||
insertDefinition(project, results[0].def, caret) | ||
myFixture.checkResult(""" | ||
\data Bool | ||
\func foo : Nat -> Bool => {?} | ||
\func lol => (foo) | ||
""".trimIndent()) | ||
} | ||
} |
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