Lukacs Berki | 14328eb | 2015-10-21 10:47:26 +0000 | [diff] [blame] | 1 | // Copyright 2006 The Bazel Authors. All rights reserved. |
Ulf Adams | 3b2ac8e | 2015-04-23 19:09:50 +0000 | [diff] [blame] | 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 | package com.google.devtools.build.lib.analysis; |
| 15 | |
lberki | aea56b3 | 2017-05-30 12:35:33 +0200 | [diff] [blame] | 16 | import static com.google.common.truth.Truth.assertThat; |
Ulf Adams | 3b2ac8e | 2015-04-23 19:09:50 +0000 | [diff] [blame] | 17 | |
| 18 | import com.google.devtools.build.lib.vfs.PathFragment; |
Ulf Adams | 3b2ac8e | 2015-04-23 19:09:50 +0000 | [diff] [blame] | 19 | import org.junit.Test; |
| 20 | import org.junit.runner.RunWith; |
| 21 | import org.junit.runners.JUnit4; |
| 22 | |
| 23 | /** |
| 24 | * Tests for the Util helper class. |
| 25 | */ |
| 26 | @RunWith(JUnit4.class) |
| 27 | public class UtilTest { |
| 28 | |
| 29 | @Test |
| 30 | public void testContainsHyphen() throws Exception { |
lberki | aea56b3 | 2017-05-30 12:35:33 +0200 | [diff] [blame] | 31 | assertThat(Util.containsHyphen(PathFragment.create("foo/bar/with-hyphen"))).isTrue(); |
| 32 | assertThat(Util.containsHyphen(PathFragment.create("foo/bar/no/hyphen"))).isFalse(); |
Ulf Adams | 3b2ac8e | 2015-04-23 19:09:50 +0000 | [diff] [blame] | 33 | } |
| 34 | } |