blob: ac34e06781a097a61bd02eeeba68882b677f84df [file] [log] [blame]
Lukacs Berki14328eb2015-10-21 10:47:26 +00001// Copyright 2006 The Bazel Authors. All rights reserved.
Ulf Adams3b2ac8e2015-04-23 19:09:50 +00002//
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.
14package com.google.devtools.build.lib.analysis;
15
lberkiaea56b32017-05-30 12:35:33 +020016import static com.google.common.truth.Truth.assertThat;
Ulf Adams3b2ac8e2015-04-23 19:09:50 +000017
18import com.google.devtools.build.lib.vfs.PathFragment;
Ulf Adams3b2ac8e2015-04-23 19:09:50 +000019import org.junit.Test;
20import org.junit.runner.RunWith;
21import org.junit.runners.JUnit4;
22
23/**
24 * Tests for the Util helper class.
25 */
26@RunWith(JUnit4.class)
27public class UtilTest {
28
29 @Test
30 public void testContainsHyphen() throws Exception {
lberkiaea56b32017-05-30 12:35:33 +020031 assertThat(Util.containsHyphen(PathFragment.create("foo/bar/with-hyphen"))).isTrue();
32 assertThat(Util.containsHyphen(PathFragment.create("foo/bar/no/hyphen"))).isFalse();
Ulf Adams3b2ac8e2015-04-23 19:09:50 +000033 }
34}