diff options
author | Colin Cross <ccross@android.com> | 2018-12-14 11:46:58 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2018-12-14 11:49:58 -0800 |
commit | 359e6436be620356b3860ab52d6e98f4a997e68a (patch) | |
tree | 4fbbc66bd25711979a533d7b444faeb1bf2ea109 /android/paths_test.go | |
parent | fee2bff77ce6d5c6a9c4f3971c385432dd7d8859 (diff) | |
download | build_soong-359e6436be620356b3860ab52d6e98f4a997e68a.tar.gz build_soong-359e6436be620356b3860ab52d6e98f4a997e68a.tar.bz2 build_soong-359e6436be620356b3860ab52d6e98f4a997e68a.zip |
Revert "Fix MaybeRel when OUT is absolute"
This reverts commit fee2bff77ce6d5c6a9c4f3971c385432dd7d8859.
Test: none
Bug: 119412419
Diffstat (limited to 'android/paths_test.go')
-rw-r--r-- | android/paths_test.go | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/android/paths_test.go b/android/paths_test.go index c4332d26..fbeccb1c 100644 --- a/android/paths_test.go +++ b/android/paths_test.go @@ -573,60 +573,3 @@ func TestDirectorySortedPaths(t *testing.T) { t.Errorf("FilesInDirectory(b):\n %#v\n != \n %#v", inA.Strings(), expectedA) } } - -func TestMaybeRel(t *testing.T) { - testCases := []struct { - name string - base string - target string - out string - isRel bool - }{ - { - name: "normal", - base: "a/b/c", - target: "a/b/c/d", - out: "d", - isRel: true, - }, - { - name: "parent", - base: "a/b/c/d", - target: "a/b/c", - isRel: false, - }, - { - name: "not relative", - base: "a/b", - target: "c/d", - isRel: false, - }, - { - name: "abs1", - base: "/a", - target: "a", - isRel: false, - }, - { - name: "abs2", - base: "a", - target: "/a", - isRel: false, - }, - } - - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - ctx := &configErrorWrapper{} - out, isRel := MaybeRel(ctx, testCase.base, testCase.target) - if len(ctx.errors) > 0 { - t.Errorf("MaybeRel(..., %s, %s) reported unexpected errors %v", - testCase.base, testCase.target, ctx.errors) - } - if isRel != testCase.isRel || out != testCase.out { - t.Errorf("MaybeRel(..., %s, %s) want %v, %v got %v, %v", - testCase.base, testCase.target, testCase.out, testCase.isRel, out, isRel) - } - }) - } -} |