blob: 0da01c72e169722e2ecc1a60baa0fd39be7ca991 [file] [log] [blame]
Craig Heslingdedf7222021-04-08 13:08:34 -07001// 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
11namespace biod {
12
13TEST(UtilsTest, LogSafeID_Normal) {
14 EXPECT_EQ(LogSafeID("0123456789_ABCDEF_0123456789"), "01*");
15}
16
17TEST(UtilsTest, LogSafeID_Small) {
18 EXPECT_EQ(LogSafeID("K"), "K");
19}
20
21TEST(UtilsTest, LogSafeID_BlankString) {
22 EXPECT_EQ(LogSafeID(""), "");
23}
24
25} // namespace biod