This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Created functions looking for "tests" in paths * Added tests * Added checkbox for exclude tests * Added total matches in snippet info. * Edited tests * [#230] Excluding search in tests: - fixed tests
- Loading branch information
1 parent
7bd2aef
commit d1fccc0
Showing
24 changed files
with
177 additions
and
36 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
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
10 changes: 10 additions & 0 deletions
10
core/src/test/scala/codesearch/core/search/HaskellSearchSpec.scala
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,10 @@ | ||
package codesearch.core.search | ||
|
||
class HaskellSearchSpec extends SearchSpecBase { | ||
"Checking on the way to tests" - { | ||
haskellIsTestInWay(path = "path/to/package/test/", result = true) | ||
haskellIsTestInWay(path = "path/to/package/testSUites/", result = true) | ||
haskellIsTestInWay(path = "path/to/package/tEsts/", result = true) | ||
haskellIsTestInWay(path = "path/to/package/tes-t/", result = false) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/test/scala/codesearch/core/search/JavaScriptSearchSpec.scala
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,10 @@ | ||
package codesearch.core.search | ||
|
||
class JavaScriptSearchSpec extends SearchSpecBase { | ||
"Checking on the way to tests" - { | ||
javaScriptIsTestInWay(path = "path/to/package/tests/", result = true) | ||
javaScriptIsTestInWay(path = "path/to/package/sPEc-class/", result = true) | ||
javaScriptIsTestInWay(path = "path/to/package/tEsts.js", result = true) | ||
javaScriptIsTestInWay(path = "path/to/package/tes-t/", result = false) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/test/scala/codesearch/core/search/RubySearchSpec.scala
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,10 @@ | ||
package codesearch.core.search | ||
|
||
class RubySearchSpec extends SearchSpecBase { | ||
"Checking on the way to tests" - { | ||
rubyIsTestInWay(path = "path/to/package/test/", result = true) | ||
rubyIsTestInWay(path = "path/to/package/spec/", result = true) | ||
rubyIsTestInWay(path = "path/to/package/tEsts/", result = false) | ||
rubyIsTestInWay(path = "path/to/package/tes-t/", result = false) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/test/scala/codesearch/core/search/RustSearchSpec.scala
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,10 @@ | ||
package codesearch.core.search | ||
|
||
class RustSearchSpec extends SearchSpecBase { | ||
"Checking on the way to tests" - { | ||
rustIsTestInWay(path = "path/to/package/tests/", result = true) | ||
rustIsTestInWay(path = "path/to/package/spec/", result = false) | ||
rustIsTestInWay(path = "path/to/package/tEsts/", result = false) | ||
rustIsTestInWay(path = "path/to/package/tes-t/", result = false) | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
core/src/test/scala/codesearch/core/search/SearchSpecBase.scala
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,42 @@ | ||
package codesearch.core.search | ||
|
||
import java.nio.file.Paths | ||
|
||
import codesearch.core.index.directory.{HaskellCindex, JavaScriptCindex, RubyCindex, RustCindex} | ||
import org.scalatest.{FreeSpec, Matchers} | ||
|
||
|
||
trait SearchSpecBase extends FreeSpec with Matchers{ | ||
val haskellCindex = HaskellCindex(Paths.get("./index/test/cindex/")) | ||
val haskellSearch = new HaskellSearch(haskellCindex) | ||
val rubyCindex = RubyCindex(Paths.get("./index/test/cindex/")) | ||
val rubySearch = new RubySearch(rubyCindex) | ||
val rustCindex = RustCindex(Paths.get("./index/test/cindex/")) | ||
val rustSearch = new RustSearch(rustCindex) | ||
val javaScriptCindex = JavaScriptCindex(Paths.get("./index/test/cindex/")) | ||
val javaScriptSearch = new JavaScriptSearch(javaScriptCindex) | ||
|
||
def haskellIsTestInWay(path: String, result: Boolean): Unit = { | ||
path in { | ||
haskellSearch.isTestInPath(path) shouldBe result | ||
} | ||
} | ||
|
||
def rubyIsTestInWay(path: String, result: Boolean): Unit = { | ||
path in { | ||
rubySearch.isTestInPath(path) shouldBe result | ||
} | ||
} | ||
|
||
def rustIsTestInWay(path: String, result: Boolean): Unit = { | ||
path in { | ||
rustSearch.isTestInPath(path) shouldBe result | ||
} | ||
} | ||
|
||
def javaScriptIsTestInWay(path: String, result: Boolean): Unit = { | ||
path in { | ||
javaScriptSearch.isTestInPath(path) shouldBe result | ||
} | ||
} | ||
} |
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
Oops, something went wrong.