From 0623eb88b1f93a9878fc5c04d4a1f71750f0eea9 Mon Sep 17 00:00:00 2001 From: Jordan Bradford <36420801+jrdnbradford@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:05:59 -0500 Subject: [PATCH] Fix `strict` schema validation test --- tests/testthat/test-lockfile-validate.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testthat/test-lockfile-validate.R b/tests/testthat/test-lockfile-validate.R index d89059d7e..f7cdb70ea 100644 --- a/tests/testthat/test-lockfile-validate.R +++ b/tests/testthat/test-lockfile-validate.R @@ -310,7 +310,7 @@ test_that("strict mode catches unknown keyword in provided schema", { } ] }, - "Packages": [ + "Packages": { "markdown": { "Package": "markdown", "Version": "1.0", @@ -318,7 +318,7 @@ test_that("strict mode catches unknown keyword in provided schema", { "Repository": "CRAN", "Hash": "4584a57f565dd7987d59dda3a02cfb41" } - ] + } } ' @@ -331,14 +331,14 @@ test_that("strict mode catches unknown keyword in provided schema", { "type": "object", "properties": { "Version": { - "type": "UNKNOWN" + "UNKNOWN": "string" } } } } } ' - - expect_error(lockfile_validate(lockfile = lockfile, strict = TRUE)) + expect_true(lockfile_validate(lockfile = lockfile, schema = schema)) + expect_error(lockfile_validate(lockfile = lockfile, schema = schema, strict = TRUE)) })