From 869ca7b52a13f5169a62c8a3f72ea37c84016241 Mon Sep 17 00:00:00 2001 From: Nick Dumas Date: Tue, 13 Jun 2023 15:03:44 -0400 Subject: [PATCH] adding a positive test case --- validate_test.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/validate_test.go b/validate_test.go index 2ab54fd..286b2a0 100644 --- a/validate_test.go +++ b/validate_test.go @@ -31,6 +31,33 @@ boop: "bop" title: 2 --- # Markdown Content +`), + expected: nil, + }, + { + name: "GoodSchema", + b: bytes.NewBufferString(` +--- +draft: false +title: "Mapping Aardwolf with Graphviz and Golang" +aliases: ["Mapping Aardwolf with Graphviz"] +series: ["mapping-aardwolf"] +date: "2023-04-06" +author: "Nick Dumas" +cover: "" +keywords: [""] +description: "Maxing out your CPU for fun and profit with dense graphs, or how I'm attempting to follow through on my plan to work on projects with more visual + outputs" +showFullContent: false +tags: +- graphviz +- graph +- aardwolf +- golang +--- + +## Textual Cartography +Aardwolf has a fairly active developer community, people who write and maintain plugins and try to map the game world and its contents. `), expected: nil, }, @@ -41,7 +68,7 @@ title: 2 t.Run(tc.name, func(t *testing.T) { t.Parallel() err := obp.Validate("https://schemas.ndumas.com/obsidian/note.schema.json", tc.b) - if err == nil { + if err == tc.expected { t.Log("Expected Validate() to fail on input") t.Fail() }