-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug#sf1258] http git repo erroneously set to svn (#1047)
* identify repo type using url Signed-off-by: Damien Rembert <[email protected]> * add tests to cover the changes Signed-off-by: Damien Rembert <[email protected]> * fix formatting Signed-off-by: Damien Rembert <[email protected]> --------- Signed-off-by: Damien Rembert <[email protected]>
- Loading branch information
1 parent
20977a4
commit 8d32dc0
Showing
2 changed files
with
62 additions
and
0 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
58 changes: 58 additions & 0 deletions
58
test/src/org/omegat/core/team2/RemoteRepositoryFactoryTest.java
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,58 @@ | ||
/************************************************************************** | ||
OmegaT - Computer Assisted Translation (CAT) tool | ||
with fuzzy matching, translation memory, keyword search, | ||
glossaries, and translation leveraging into updated projects. | ||
Copyright (C) 2024 Damien Rembert | ||
Home page: https://www.omegat.org/ | ||
Support center: https://omegat.org/support | ||
This file is part of OmegaT. | ||
OmegaT is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OmegaT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
**************************************************************************/ | ||
|
||
package org.omegat.core.team2; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
|
||
public final class RemoteRepositoryFactoryTest { | ||
|
||
@Test | ||
public void testDetectRepositoryType_svnPrefix() { | ||
String url = "svn://example.com/repo"; | ||
assertEquals("svn", RemoteRepositoryFactory.detectRepositoryType(url)); | ||
} | ||
|
||
@Test | ||
public void testDetectRepositoryType_gitPrefix() { | ||
String url = "git://example.com/repo"; | ||
assertEquals("git", RemoteRepositoryFactory.detectRepositoryType(url)); | ||
} | ||
|
||
@Test | ||
public void testDetectRepositoryType_httpsGitPrefix() { | ||
String url = "https://git.example.com/repo"; | ||
assertEquals("git", RemoteRepositoryFactory.detectRepositoryType(url)); | ||
} | ||
|
||
@Test | ||
public void testDetectRepositoryType_gitSuffix() { | ||
String url = "https://example.com/repo.git"; | ||
assertEquals("git", RemoteRepositoryFactory.detectRepositoryType(url)); | ||
} | ||
|
||
} |