Skip to content

Commit

Permalink
Move and rename dummy git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed May 12, 2018
1 parent c1dd493 commit b0d661b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "test"]
path = test
url = ./test
[submodule "dummy_repo"]
path = assets/dummy_repo
url = ./assets/dummy_repo
ignore = dirty
Submodule dummy_repo updated from 000000 to 52015f
20 changes: 11 additions & 9 deletions conflict/command_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package conflict
package conflict_test

import (
"strings"
"testing"

"github.com/mkchoi212/fac/conflict"
)

var TestGitPath = "../test"
var TestGitSubPath = "../test/assets"
var CorrectNumMarkers = 75
var TestGitPath = "assets/dummy_repo"
var TestGitSubPath = "../assets/dummy_repo/assets"
var CorrectNumMarkers = 109

func TestMarkerLocations(t *testing.T) {
markers, ok := MarkerLocations(TestGitPath)
markers, ok := conflict.MarkerLocations("../" + TestGitPath)
if ok != nil {
t.Errorf("git diff --check failed with error: %s", ok.Error())
}
Expand All @@ -22,7 +24,7 @@ func TestMarkerLocations(t *testing.T) {
}

func TestMarkerLocationsFromSubPath(t *testing.T) {
markers, ok := MarkerLocations(TestGitSubPath)
markers, ok := conflict.MarkerLocations(TestGitSubPath)
if ok != nil {
t.Errorf("git diff --check from sub-directory failed with error: %s", ok.Error())
}
Expand All @@ -34,13 +36,13 @@ func TestMarkerLocationsFromSubPath(t *testing.T) {
}

func TestTopLevelPath(t *testing.T) {
topPath, ok := TopLevelPath(TestGitSubPath)
topPath, ok := conflict.TopLevelPath(TestGitSubPath)

if ok != nil {
t.Errorf("git rev-parse --show-toplevel failed")
}

if !(strings.Contains(topPath, "fac/test")) {
t.Errorf("git rev-parse --show-toplevel was incorrect: got %s, want, %s", topPath, "../fac/test")
if !(strings.Contains(topPath, TestGitPath)) {
t.Errorf("git rev-parse --show-toplevel was incorrect: got %s, want, %s", topPath, "../"+TestGitPath)
}
}

0 comments on commit b0d661b

Please sign in to comment.