summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTy Coghlan <Coghlan.Ty@gmail.com>2018-08-27 01:12:56 -0400
committerTy Coghlan <Coghlan.Ty@gmail.com>2018-08-30 22:10:38 -0400
commit8e3bf10592b52ba96ce94c5819a19ee8de6f0899 (patch)
tree86f17f793726520f886211466c18fd53fb3182d7 /test
parentea01cc708b4beed3831a10065664c84dba68b5dc (diff)
downloadale-8e3bf10592b52ba96ce94c5819a19ee8de6f0899.zip
added sbtserver linter
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_scala_sbtserver.vader25
-rw-r--r--test/scala_fixtures/invalid_sbt_project/Main.scala5
-rw-r--r--test/scala_fixtures/invalid_sbt_project/project/build.properties1
-rw-r--r--test/scala_fixtures/invalid_sbt_project/project/target/active.json1
-rw-r--r--test/scala_fixtures/no_active_sbt_project/Main.scala5
-rw-r--r--test/scala_fixtures/no_active_sbt_project/build.sbt3
-rw-r--r--test/scala_fixtures/no_active_sbt_project/project/build.properties1
-rw-r--r--test/scala_fixtures/valid_sbt_project/Main.scala5
-rw-r--r--test/scala_fixtures/valid_sbt_project/build.sbt3
-rw-r--r--test/scala_fixtures/valid_sbt_project/project/build.properties1
-rw-r--r--test/scala_fixtures/valid_sbt_project/project/target/active.json1
11 files changed, 51 insertions, 0 deletions
diff --git a/test/command_callback/test_scala_sbtserver.vader b/test/command_callback/test_scala_sbtserver.vader
new file mode 100644
index 00000000..40aacaf4
--- /dev/null
+++ b/test/command_callback/test_scala_sbtserver.vader
@@ -0,0 +1,25 @@
+" Author: ophirr33 <coghlan.ty@gmail.com>
+" Description: Tests for the sbt Server lsp linter
+
+Before:
+ call ale#assert#SetUpLinterTest('scala', 'sbtserver')
+After:
+ call ale#assert#TearDownLinterTest()
+Execute(should set sbtserver for sbt project with active.json):
+ call ale#test#SetFilename('../scala_fixtures/valid_sbt_project/Main.scala')
+ AssertLSPLanguage 'scala'
+ AssertLSPOptions {}
+ AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../scala_fixtures/valid_sbt_project')
+ AssertLSPAddress '127.0.0.1:5211'
+Execute(should not set sbtserver for sbt project without active.json):
+ call ale#test#SetFilename('../scala_fixtures/no_active_sbt_project/Main.scala')
+ AssertLSPLanguage 'scala'
+ AssertLSPOptions {}
+ AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../scala_fixtures/no_active_sbt_project')
+ AssertLSPAddress ''
+Execute(should not set sbtserver for sbt project without build.sbt):
+ call ale#test#SetFilename('../scala_fixtures/invalid_sbt_project/Main.scala')
+ AssertLSPLanguage 'scala'
+ AssertLSPOptions {}
+ AssertLSPProject ''
+ AssertLSPAddress ''
diff --git a/test/scala_fixtures/invalid_sbt_project/Main.scala b/test/scala_fixtures/invalid_sbt_project/Main.scala
new file mode 100644
index 00000000..8431ac25
--- /dev/null
+++ b/test/scala_fixtures/invalid_sbt_project/Main.scala
@@ -0,0 +1,5 @@
+object HelloAle {
+ def main(args: Array[String]): Int = {
+ println("Hello, ale!")
+ }
+}
diff --git a/test/scala_fixtures/invalid_sbt_project/project/build.properties b/test/scala_fixtures/invalid_sbt_project/project/build.properties
new file mode 100644
index 00000000..5620cc50
--- /dev/null
+++ b/test/scala_fixtures/invalid_sbt_project/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.2.1
diff --git a/test/scala_fixtures/invalid_sbt_project/project/target/active.json b/test/scala_fixtures/invalid_sbt_project/project/target/active.json
new file mode 100644
index 00000000..0ecdb533
--- /dev/null
+++ b/test/scala_fixtures/invalid_sbt_project/project/target/active.json
@@ -0,0 +1 @@
+{"uri":"tcp://127.0.0.1:5211"}
diff --git a/test/scala_fixtures/no_active_sbt_project/Main.scala b/test/scala_fixtures/no_active_sbt_project/Main.scala
new file mode 100644
index 00000000..8431ac25
--- /dev/null
+++ b/test/scala_fixtures/no_active_sbt_project/Main.scala
@@ -0,0 +1,5 @@
+object HelloAle {
+ def main(args: Array[String]): Int = {
+ println("Hello, ale!")
+ }
+}
diff --git a/test/scala_fixtures/no_active_sbt_project/build.sbt b/test/scala_fixtures/no_active_sbt_project/build.sbt
new file mode 100644
index 00000000..f50b72d2
--- /dev/null
+++ b/test/scala_fixtures/no_active_sbt_project/build.sbt
@@ -0,0 +1,3 @@
+name := "ale-scala-valid"
+version := "1.0"
+scalaVersion := "2.12.6"
diff --git a/test/scala_fixtures/no_active_sbt_project/project/build.properties b/test/scala_fixtures/no_active_sbt_project/project/build.properties
new file mode 100644
index 00000000..5620cc50
--- /dev/null
+++ b/test/scala_fixtures/no_active_sbt_project/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.2.1
diff --git a/test/scala_fixtures/valid_sbt_project/Main.scala b/test/scala_fixtures/valid_sbt_project/Main.scala
new file mode 100644
index 00000000..8431ac25
--- /dev/null
+++ b/test/scala_fixtures/valid_sbt_project/Main.scala
@@ -0,0 +1,5 @@
+object HelloAle {
+ def main(args: Array[String]): Int = {
+ println("Hello, ale!")
+ }
+}
diff --git a/test/scala_fixtures/valid_sbt_project/build.sbt b/test/scala_fixtures/valid_sbt_project/build.sbt
new file mode 100644
index 00000000..f50b72d2
--- /dev/null
+++ b/test/scala_fixtures/valid_sbt_project/build.sbt
@@ -0,0 +1,3 @@
+name := "ale-scala-valid"
+version := "1.0"
+scalaVersion := "2.12.6"
diff --git a/test/scala_fixtures/valid_sbt_project/project/build.properties b/test/scala_fixtures/valid_sbt_project/project/build.properties
new file mode 100644
index 00000000..5620cc50
--- /dev/null
+++ b/test/scala_fixtures/valid_sbt_project/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.2.1
diff --git a/test/scala_fixtures/valid_sbt_project/project/target/active.json b/test/scala_fixtures/valid_sbt_project/project/target/active.json
new file mode 100644
index 00000000..0ecdb533
--- /dev/null
+++ b/test/scala_fixtures/valid_sbt_project/project/target/active.json
@@ -0,0 +1 @@
+{"uri":"tcp://127.0.0.1:5211"}