generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #219 from bobi/dev
Dev
- Loading branch information
Showing
7 changed files
with
181 additions
and
46 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 |
---|---|---|
|
@@ -42,7 +42,7 @@ jobs: | |
|
||
# Validate wrapper | ||
- name: Gradle Wrapper Validation | ||
uses: gradle/[email protected].1 | ||
uses: gradle/[email protected].2 | ||
|
||
# Set up Java environment for the next steps | ||
- name: Setup Java | ||
|
@@ -170,7 +170,7 @@ jobs: | |
|
||
# Run Qodana inspections | ||
- name: Qodana - Code Inspection | ||
uses: JetBrains/[email protected].1 | ||
uses: JetBrains/[email protected].2 | ||
with: | ||
cache-default-branch-only: true | ||
|
||
|
@@ -207,7 +207,7 @@ jobs: | |
|
||
# Cache Plugin Verifier IDEs | ||
- name: Setup Plugin Verifier IDEs Cache | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides | ||
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} | ||
|
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
132 changes: 132 additions & 0 deletions
132
...om/github/bobi/aemgroovyconsoleplugin/execution/table/AemConsoleTableSearchSessionTest.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,132 @@ | ||
package com.github.bobi.aemgroovyconsoleplugin.execution.table | ||
|
||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
|
||
|
||
/** | ||
* User: Andrey Bardashevsky | ||
* Date/Time: 2024-03-15 20:06 | ||
*/ | ||
|
||
/* Table: | ||
0 1 2 3 4 | ||
5 6 7 8 9 | ||
10 11 12 13 14 | ||
15 16 17 18 19 | ||
20 21 22 23 24 | ||
*/ | ||
|
||
class AemConsoleTableSearchSessionTest { | ||
private val rowCount = 5 | ||
|
||
private val columnCount = 5 | ||
|
||
@Test | ||
fun getSearchCellsRangeForwardIncludeStart() { | ||
val forward = true | ||
val includeStartCell = true | ||
|
||
assertEquals( | ||
((6..24) + (0..5)).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
1, 1, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
|
||
assertEquals( | ||
(0..24).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
-1, -1, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
|
||
assertEquals( | ||
((24..24) + (0..23)).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
10, 10, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
} | ||
|
||
@Test | ||
fun getSearchCellsRangeBackwardIncludeStart() { | ||
val forward = false | ||
val includeStartCell = true | ||
|
||
assertEquals( | ||
((6 downTo 0) + (24 downTo 7)).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
1, 1, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
|
||
assertEquals( | ||
((0..0) + (24 downTo 1)).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
-1, -1, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
|
||
assertEquals( | ||
(24 downTo 0).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
10, 10, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
} | ||
|
||
@Test | ||
fun getSearchCellsRangeForwardSkipStart() { | ||
val forward = true | ||
val includeStartCell = false | ||
|
||
assertEquals( | ||
((7..24) + (0..6)).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
1, 1, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
|
||
assertEquals( | ||
((1..24) + (0..0)).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
-1, -1, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
|
||
assertEquals( | ||
(0..24).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
10, 10, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
} | ||
|
||
@Test | ||
fun getSearchCellsRangeBackwardSkipStart() { | ||
val forward = false | ||
val includeStartCell = false | ||
|
||
assertEquals( | ||
((5 downTo 0) + (24 downTo 6)).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
1, 1, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
|
||
assertEquals( | ||
(24 downTo 0).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
-1, -1, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
|
||
assertEquals( | ||
((23 downTo 0) + (24..24)).toList(), | ||
AemConsoleTableSearchSession.getSearchCellsRange( | ||
10, 10, rowCount, columnCount, forward, includeStartCell | ||
).toList(), | ||
) | ||
} | ||
} |