Benign repos Download

str_util_test.cc

imports tsl/platform/str_util.himports xla/tsl/platform/test.h
SHA-25670f09ef1c58a48af15d96abe2a101af0cb59cded8444d8f619115e71a47b2741

Evidence

apache web server name lines 1–10
1/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
imports tsl/platform/str_util.h lines 11–27
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tsl/platform/str_util.h"
17
18#include <vector>
19
20#include "xla/tsl/platform/test.h"
21
22namespace tsl {
23
24TEST(CEscape, Basic) {
25 EXPECT_EQ(absl::CEscape("hello"), "hello");
26 EXPECT_EQ(absl::CEscape("hello\n"), "hello\\n");
27 EXPECT_EQ(absl::CEscape("hello\r"), "hel …
C/C++ unit-test EXPECT_TRUE marker lines 32–40
32:43… tring_view source) {
33 std::string dest;
34 std::string error;
35 EXPECT_TRUE(absl::CUnescape(source, &dest, &error)) << error;
36 return dest;
37}
38
39TEST(CUnescape, Basic) {
40 EXPECT_EQ("hello", ExpectCUnesca …
English function-word token "that" lines 84–88
84:42… \t";
85 absl::string_view data(text);
86 // check that all whitespace is removed
87 EXPECT_EQ(str_util::RemoveLeadingWhitespace(&data), 11);
88 EXPECT_E …
C/C++ unit-test ASSERT_EQ marker lines 324–332
324:12… ng s = "sparse_lookup";
325 str_util::TitlecaseString(&s, "_");
326 ASSERT_EQ(s, "Sparse_Lookup");
327
328 s = "sparse_lookup";
⋯4 lines

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.