[PATCH] D140474: [YAML IO] Check that mapping doesn't contain duplicating keys

Anton Sidorenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 01:02:33 PST 2023


asi-sc added inline comments.


================
Comment at: llvm/unittests/Support/YAMLIOTest.cpp:108-110
+//
+// Test the reading of a map containing duplicated keys
+//
----------------
jhenderson wrote:
> This comment doesn't really add anything that the test name can't capture.
I agree. It's just the structure of this test, but such comments don't give any additional information. So, I've just removed it.


================
Comment at: llvm/unittests/Support/YAMLIOTest.cpp:115-117
+  Input yin("{foo: 3\n bar: 5\nfoo: 3}", nullptr, suppressErrorMessages);
+  yin >> doc;
+  EXPECT_TRUE(!!yin.error());
----------------
jhenderson wrote:
> I see that this is the pattern used above, but is there any way of testing that the error message is correct? If not, we may well want the yaml2obj test (optionally in addition to the unit test).
Fixed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140474/new/

https://reviews.llvm.org/D140474



More information about the llvm-commits mailing list