From 7d26f9e1329f981ed43eb31f66891702de2f6470 Mon Sep 17 00:00:00 2001 From: Jordan Rupprecht Date: Tue, 29 Nov 2022 04:34:40 -0800 Subject: [PATCH] [test] Allow libc++ namespaces besides `__1` The libc++ data formatter for `std::shared_ptr` allows any namespace, but the test asserts that it must be the default `__1` namespace. Relax the regex to allow anything that looks like `__.*` (although we use `__[^:]*` so we don't match arbitrarily long text). Reviewed By: labath Differential Revision: https://reviews.llvm.org/D129898 --- .../forward_decl_from_module/TestForwardDeclFromStdModule.py | 2 +- .../libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py index 943aa5b..6adf016 100644 --- a/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py +++ b/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py @@ -37,4 +37,4 @@ class TestCase(TestBase): # Both `std::vector` and the type of the member have forward # declarations before their definitions. self.expect("expr --raw -- v", - substrs=['(std::__1::vector) $0 = {', 'f = nullptr', '}']) + patterns=[r'\(std::__[^:]*::vector\) \$0 = {', 'f = nullptr', '}']) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py index 663058e..c646fcc 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py @@ -68,7 +68,7 @@ class TestCase(TestBase): valobj = self.expect_var_path("sp_user", type="std::shared_ptr") self.assertRegex( valobj.summary, - "^std(::__1)?::shared_ptr::element_type @ 0x0*[1-9a-f][0-9a-f]+( strong=1)? weak=1", + "^std(::__[^:]*)?::shared_ptr::element_type @ 0x0*[1-9a-f][0-9a-f]+( strong=1)? weak=1", ) self.assertNotEqual(valobj.child[0].unsigned, 0) -- 2.7.4