================
@@ -0,0 +1,56 @@
+#include "support/Markdown.h"
+#include "llvm/Support/Casting.h"
+#include "gtest/gtest.h"
+
+using namespace clang::doc::markdown;
+using namespace llvm;
+
+namespace {
+
+TEST(MarkdownNodeTest, TextNode) {
+  TextNode N("hello");
+  EXPECT_EQ(N.Kind, NodeKind::NK_Text);
+  EXPECT_EQ(N.Text, "hello");
+}
+
+TEST(MarkdownNodeTest, FencedCodeNode) {
+  StringRef Lines[] = {"int x = 0;"};
+  FencedCodeNode N("cpp", ArrayRef(Lines));
+  EXPECT_EQ(N.Kind, NodeKind::NK_FencedCode);
+  EXPECT_EQ(N.Lang, "cpp");
+  EXPECT_EQ(N.Lines.size(), 1u);
----------------
ilovepi wrote:

If you're going to test like this, I'd at least test that the array  works with 
more than 1 item in it. It obviously will, but you're just testing invariants 
right now.

https://github.com/llvm/llvm-project/pull/205609
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to