[Lldb-commits] [lldb] [LLDB] Add Lexer (with tests) for DIL (Data Inspection Language). (PR #123521)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 27 04:37:26 PST 2025
================
@@ -0,0 +1,218 @@
+//===-- DILLexerTests.cpp --------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/ValueObject/DILLexer.h"
+#include "llvm/ADT/StringRef.h"
+#include "gtest/gtest.h"
+#include <string>
+
+using llvm::StringRef;
+
+bool VerifyExpectedTokens(
----------------
labath wrote:
There's a reason why I used `EXPECT_THAT(..., ElementsAre()` in my example -- it gives *much* better error messages in case of failure: It will print the *expected* vector, the *actual* vector, and also the element which differs.
With an implementation like this, all you get is `error: false != true`. Which one would you rather debug?
https://github.com/llvm/llvm-project/pull/123521
More information about the lldb-commits
mailing list