diff options
author | Aaron Danen <aaron.danen@gmail.com> | 2025-07-23 02:13:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-23 10:13:11 +0100 |
commit | c295f050633ba4feb3e2ed74811b9c9d7add758d (patch) | |
tree | 8cf34a9889e2849864d78d15845a994493528ecf /clang/unittests/Interpreter/InterpreterTest.cpp | |
parent | 2a5cd50c469891a0bc918b42785cbf6fd6132a50 (diff) | |
download | llvm-c295f050633ba4feb3e2ed74811b9c9d7add758d.zip llvm-c295f050633ba4feb3e2ed74811b9c9d7add758d.tar.gz llvm-c295f050633ba4feb3e2ed74811b9c9d7add758d.tar.bz2 |
[clang-repl] Improve error message on failed undos (#149396)
Updated error message logic for undo function. Throws different errors
for the case of there being nothing to undo, and for the case of
requesting more undos than there are operations to undo.
Fixes https://github.com/llvm/llvm-project/issues/143668
Diffstat (limited to 'clang/unittests/Interpreter/InterpreterTest.cpp')
-rw-r--r-- | clang/unittests/Interpreter/InterpreterTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp index 2ba15cb..768058b 100644 --- a/clang/unittests/Interpreter/InterpreterTest.cpp +++ b/clang/unittests/Interpreter/InterpreterTest.cpp @@ -160,12 +160,12 @@ TEST_F(InterpreterTest, UndoCommand) { // Fail to undo. auto Err1 = Interp->Undo(); - EXPECT_EQ("Operation failed. Too many undos", + EXPECT_EQ("Operation failed. No input left to undo", llvm::toString(std::move(Err1))); auto Err2 = Interp->Parse("int foo = 42;"); EXPECT_TRUE(!!Err2); auto Err3 = Interp->Undo(2); - EXPECT_EQ("Operation failed. Too many undos", + EXPECT_EQ("Operation failed. Wanted to undo 2 inputs, only have 1.", llvm::toString(std::move(Err3))); // Succeed to undo. |