From 1f90eb365e06e1f7c3aa48c9161a04fe8e0febfd Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 28 May 2024 10:10:51 -0700 Subject: [PATCH] Clean up tests and transcripts --- unison-cli/tests/Main.hs | 2 -- unison-cli/tests/Unison/Test/UriParser.hs | 44 +++-------------------- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/unison-cli/tests/Main.hs b/unison-cli/tests/Main.hs index b94d9407f..c0aa02275 100644 --- a/unison-cli/tests/Main.hs +++ b/unison-cli/tests/Main.hs @@ -6,7 +6,6 @@ import System.IO import System.IO.CodePage (withCP65001) import Unison.Test.ClearCache qualified as ClearCache import Unison.Test.Cli.Monad qualified as Cli.Monad -import Unison.Test.GitSync qualified as GitSync import Unison.Test.LSP qualified as LSP import Unison.Test.UriParser qualified as UriParser @@ -16,7 +15,6 @@ test = [ LSP.test, ClearCache.test, Cli.Monad.test, - GitSync.test, UriParser.test ] diff --git a/unison-cli/tests/Unison/Test/UriParser.hs b/unison-cli/tests/Unison/Test/UriParser.hs index ba71a26ba..e1eaacabf 100644 --- a/unison-cli/tests/Unison/Test/UriParser.hs +++ b/unison-cli/tests/Unison/Test/UriParser.hs @@ -6,7 +6,7 @@ import Data.These (These (..)) import Data.Void (Void) import EasyTest import Text.Megaparsec qualified as P -import Unison.Codebase.Editor.RemoteRepo (ReadGitRepo (..), ReadRemoteNamespace (..), ShareCodeserver (..), ShareUserHandle (..), WriteGitRemoteNamespace (..), WriteGitRepo (..), WriteRemoteNamespace (..), WriteShareRemoteNamespace (..), pattern ReadGitRemoteNamespace, pattern ReadShareLooseCode) +import Unison.Codebase.Editor.RemoteRepo (ReadRemoteNamespace (..), ShareCodeserver (..), ShareUserHandle (..), WriteRemoteNamespace (..), WriteShareRemoteNamespace (..), pattern ReadShareLooseCode) import Unison.Codebase.Editor.UriParser qualified as UriParser import Unison.Codebase.Path qualified as Path import Unison.Codebase.ShortCausalHash (ShortCausalHash (..)) @@ -23,22 +23,7 @@ test = [ ("unisonweb.base._releases.M4", looseR "unisonweb" ["base", "_releases", "M4"]), ("project", branchR (This "project")), ("/branch", branchR (That "branch")), - ("project/branch", branchR (These "project" "branch")), - ("git(/srv/git/project.git)", gitR "/srv/git/project.git" Nothing Nothing []), - ("git(/srv/git/project.git:abc)#def.hij.klm", gitR "/srv/git/project.git" (Just "abc") (sch "def") ["hij", "klm"]), - ("git(srv/git/project.git)", gitR "srv/git/project.git" Nothing Nothing []), - ("git(srv/git/project.git:abc)#def.hij.klm", gitR "srv/git/project.git" (Just "abc") (sch "def") ["hij", "klm"]), - ("git(file:///srv/git/project.git)", gitR "file:///srv/git/project.git" Nothing Nothing []), - ("git(file:///srv/git/project.git:abc)#def.hij.klm", gitR "file:///srv/git/project.git" (Just "abc") (sch "def") ["hij", "klm"]), - ("git(file://srv/git/project.git)", gitR "file://srv/git/project.git" Nothing Nothing []), - ("git(file://srv/git/project.git:abc)#def.hij.klm", gitR "file://srv/git/project.git" (Just "abc") (sch "def") ["hij", "klm"]), - ("git(https://example.com/git/project.git)", gitR "https://example.com/git/project.git" Nothing Nothing []), - ("git(https://user@example.com/git/project.git:abc)#def.hij.klm", gitR "https://user@example.com/git/project.git" (Just "abc") (sch "def") ["hij", "klm"]), - ("git(ssh://git@8.8.8.8:222/user/project.git)", gitR "ssh://git@8.8.8.8:222/user/project.git" Nothing Nothing []), - ("git(ssh://git@github.com/user/project.git:abc)#def.hij.klm", gitR "ssh://git@github.com/user/project.git" (Just "abc") (sch "def") ["hij", "klm"]), - ("git(git@github.com:user/project.git)", gitR "git@github.com:user/project.git" Nothing Nothing []), - ("git(github.com:user/project.git)", gitR "github.com:user/project.git" Nothing Nothing []), - ("git(git@github.com:user/project.git:abc)#def.hij.klm", gitR "git@github.com:user/project.git" (Just "abc") (sch "def") ["hij", "klm"]) + ("project/branch", branchR (These "project" "branch")) ] [".unisonweb.base"], parserTests @@ -47,33 +32,12 @@ test = [ ("unisonweb.base._releases.M4", looseW "unisonweb" ["base", "_releases", "M4"]), ("project", branchW (This "project")), ("/branch", branchW (That "branch")), - ("project/branch", branchW (These "project" "branch")), - ("git(/srv/git/project.git)", gitW "/srv/git/project.git" Nothing []), - ("git(srv/git/project.git)", gitW "srv/git/project.git" Nothing []), - ("git(file:///srv/git/project.git)", gitW "file:///srv/git/project.git" Nothing []), - ("git(file://srv/git/project.git)", gitW "file://srv/git/project.git" Nothing []), - ("git(https://example.com/git/project.git)", gitW "https://example.com/git/project.git" Nothing []), - ("git(ssh://git@8.8.8.8:222/user/project.git)", gitW "ssh://git@8.8.8.8:222/user/project.git" Nothing []), - ("git(git@github.com:user/project.git)", gitW "git@github.com:user/project.git" Nothing []), - ("git(github.com:user/project.git)", gitW "github.com:user/project.git" Nothing []) + ("project/branch", branchW (These "project" "branch")) ] - [ ".unisonweb.base", - "git(/srv/git/project.git:abc)#def.hij.klm", - "git(srv/git/project.git:abc)#def.hij.klm", - "git(file:///srv/git/project.git:abc)#def.hij.klm", - "git(file://srv/git/project.git:abc)#def.hij.klm", - "git(https://user@example.com/git/project.git:abc)#def.hij.klm", - "git(ssh://git@github.com/user/project.git:abc)#def.hij.klm", - "git(git@github.com:user/project.git:abc)#def.hij.klm" + [ ".unisonweb.base" ] ] -gitR :: Text -> Maybe Text -> Maybe ShortCausalHash -> [NameSegment] -> ReadRemoteNamespace void -gitR url ref sch path = ReadRemoteNamespaceGit (ReadGitRemoteNamespace (ReadGitRepo url ref) sch (Path.fromList path)) - -gitW :: Text -> Maybe Text -> [NameSegment] -> WriteRemoteNamespace void -gitW url branch path = WriteRemoteNamespaceGit (WriteGitRemoteNamespace (WriteGitRepo url branch) (Path.fromList path)) - looseR :: Text -> [NameSegment] -> ReadRemoteNamespace void looseR user path = ReadShare'LooseCode (ReadShareLooseCode DefaultCodeserver (ShareUserHandle user) (Path.fromList path))