Craig Hesling | dedf722 | 2021-04-08 13:08:34 -0700 | [diff] [blame] | 1 | // Copyright 2021 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "biod/utils.h" |
| 6 | |
| 7 | #include <string> |
| 8 | |
| 9 | #include <gtest/gtest.h> |
| 10 | |
| 11 | namespace biod { |
| 12 | |
| 13 | TEST(UtilsTest, LogSafeID_Normal) { |
| 14 | EXPECT_EQ(LogSafeID("0123456789_ABCDEF_0123456789"), "01*"); |
| 15 | } |
| 16 | |
| 17 | TEST(UtilsTest, LogSafeID_Small) { |
| 18 | EXPECT_EQ(LogSafeID("K"), "K"); |
| 19 | } |
| 20 | |
| 21 | TEST(UtilsTest, LogSafeID_BlankString) { |
| 22 | EXPECT_EQ(LogSafeID(""), ""); |
| 23 | } |
| 24 | |
| 25 | } // namespace biod |