blob: 3ea2f6b7d702791e5ac64d88b17f2102dd16efe4 [file] [log] [blame]
Dan Willemsena03cf6d2016-09-26 15:45:04 -07001// Copyright 2016 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package config
16
17import (
18 "testing"
19)
20
21func TestTidyChecksForDir(t *testing.T) {
Colin Cross323dc602020-09-18 14:25:31 -070022 t.Parallel()
Dan Willemsena03cf6d2016-09-26 15:45:04 -070023 testCases := []struct {
24 input string
25 expected string
26 }{
27 {"foo/bar", tidyDefault},
28 {"vendor/foo/bar", tidyExternalVendor},
29 {"vendor/google", tidyDefault},
30 {"vendor/google/foo", tidyDefault},
31 {"vendor/google_devices/foo", tidyExternalVendor},
32 }
33
34 for _, testCase := range testCases {
35 t.Run(testCase.input, func(t *testing.T) {
36 output := TidyChecksForDir(testCase.input)
37 if output != testCase.expected {
38 t.Error("Output doesn't match expected", output, testCase.expected)
39 }
40 })
41 }
42}