diff options
author | Guillaume Massé <masgui@gmail.com> | 2018-03-03 21:52:26 +0100 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-03-03 12:52:26 -0800 |
commit | 3b5e0bd58c42edd6431d0cda0e5a4b03cfa41b25 (patch) | |
tree | c64daf5cc4cf2abdb359728bbc9733d2347c92be /scalalib/test | |
parent | a3af0196caff845378d12c8fbaf2a700e1b3371d (diff) | |
download | mill-3b5e0bd58c42edd6431d0cda0e5a4b03cfa41b25.tar.gz mill-3b5e0bd58c42edd6431d0cda0e5a4b03cfa41b25.tar.bz2 mill-3b5e0bd58c42edd6431d0cda0e5a4b03cfa41b25.zip |
Bugfix/version contol (#192)
* Fix several issues in VersionControl & add Test
* Move VersionControl to it's own file
Diffstat (limited to 'scalalib/test')
-rw-r--r-- | scalalib/test/src/mill/scalalib/VersionControlTests.scala | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/scalalib/test/src/mill/scalalib/VersionControlTests.scala b/scalalib/test/src/mill/scalalib/VersionControlTests.scala new file mode 100644 index 00000000..fafdca2d --- /dev/null +++ b/scalalib/test/src/mill/scalalib/VersionControlTests.scala @@ -0,0 +1,74 @@ +package mill.scalalib + +import mill.scalalib.publish.{VersionControl, VersionControlConnection} + +import utest._ + +object VersionContolTests extends TestSuite { + + import VersionControl._ + import VersionControlConnection._ + + val tests = Tests { + 'github - { + assert( + github("lihaoyi", "mill") == + VersionControl( + browsableRepository = Some("https://github.com/lihaoyi/mill"), + connection = Some("scm:git:git://github.com/lihaoyi/mill.git"), + developerConnection = Some("scm:git:ssh://git@github.com:lihaoyi/mill.git"), + tag = None + ) + ) + } + 'git - { + assert( + gitGit("example.org", "path.git", port = Some(9418)) == + "scm:git:git://example.org:9418/path.git" + ) + + assert( + gitHttp("example.org") == + "scm:git:http://example.org/" + ) + + assert( + gitHttps("example.org", "path.git") == + "scm:git:https://example.org/path.git" + ) + + assert( + gitSsh("example.org", "path.git") == + "scm:git:ssh://example.org/path.git" + ) + + assert( + gitFile("/home/gui/repos/foo/bare.git") == + "scm:git:file:///home/gui/repos/foo/bare.git" + ) + + } + 'svn - { + assert( + svnSsh("example.org", "repo") == + "scm:svn:svn+ssh://example.org/repo" + ) + assert( + svnHttp("example.org", "repo", Some("user"), Some("pass")) == + "scm:svn:http://user:pass@example.org/repo" + ) + assert( + svnHttps("example.org", "repo", Some("user")) == + "scm:svn:https://user@example.org/repo" + ) + assert( + svnSvn("example.org", "repo", port = Some(3690)) == + "scm:svn:svn://example.org:3690/repo" + ) + assert( + svnFile("/var/svn/repo") == + "scm:svn:file:///var/svn/repo" + ) + } + } +}
\ No newline at end of file |