Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1167)

Unified Diff: sandbox/linux/bpf_dsl/cons_unittest.cc

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/bpf_dsl/cons.h ('k') | sandbox/linux/bpf_dsl/policy_compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/bpf_dsl/cons_unittest.cc
diff --git a/sandbox/linux/bpf_dsl/cons_unittest.cc b/sandbox/linux/bpf_dsl/cons_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ea2ba2f8dcbc5c5818231ebe110ba9ced02f3b15
--- /dev/null
+++ b/sandbox/linux/bpf_dsl/cons_unittest.cc
@@ -0,0 +1,33 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sandbox/linux/bpf_dsl/cons.h"
+
+#include <string>
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace sandbox {
+namespace {
+
+std::string Join(cons::List<char> char_list) {
+ std::string res;
+ for (const char& ch : char_list) {
+ res.push_back(ch);
+ }
+ return res;
+}
+
+TEST(ConsListTest, Basic) {
+ cons::List<char> ba = Cons('b', Cons('a', cons::List<char>()));
+ EXPECT_EQ("ba", Join(ba));
+
+ cons::List<char> cba = Cons('c', ba);
+ cons::List<char> dba = Cons('d', ba);
+ EXPECT_EQ("cba", Join(cba));
+ EXPECT_EQ("dba", Join(dba));
+}
+
+} // namespace
+} // namespace sandbox
« no previous file with comments | « sandbox/linux/bpf_dsl/cons.h ('k') | sandbox/linux/bpf_dsl/policy_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698