From cf343a43855ed0320109cef639ebc9e61c0ecd3e Mon Sep 17 00:00:00 2001 From: Patrick Doyle Date: Sat, 7 Sep 2024 19:37:26 -0400 Subject: [PATCH] Test names with dots (plus minor fixes) --- bosk-core/src/main/java/works/bosk/Bosk.java | 3 ++- .../main/java/works/bosk/drivers/DriverConformanceTest.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bosk-core/src/main/java/works/bosk/Bosk.java b/bosk-core/src/main/java/works/bosk/Bosk.java index 500cbe5d..d62eb58a 100644 --- a/bosk-core/src/main/java/works/bosk/Bosk.java +++ b/bosk-core/src/main/java/works/bosk/Bosk.java @@ -106,6 +106,7 @@ public class Bosk implements BoskInfo { * * @see DriverStack */ + @SuppressWarnings("this-escape") public Bosk(String name, Type rootType, DefaultRootFunction defaultRootFunction, DriverFactory driverFactory) { this.name = name; this.localDriver = new LocalDriver(defaultRootFunction); @@ -136,7 +137,7 @@ public Bosk(String name, Type rootType, DefaultRootFunction defaultRootFuncti rawClass(rootType).cast(this.currentRoot); // Ok, we're done initializing - boskInfo.boskRef().set(this); + boskInfo.boskRef().set(this); // @SuppressWarnings("this-escape") } public interface DefaultRootFunction { diff --git a/bosk-testing/src/main/java/works/bosk/drivers/DriverConformanceTest.java b/bosk-testing/src/main/java/works/bosk/drivers/DriverConformanceTest.java index e88270c1..3e7a40f8 100644 --- a/bosk-testing/src/main/java/works/bosk/drivers/DriverConformanceTest.java +++ b/bosk-testing/src/main/java/works/bosk/drivers/DriverConformanceTest.java @@ -389,7 +389,7 @@ void mapValue_works() throws InvalidTypeException { MapValue originalMapValue = MapValue.fromFunction(asList("key.with.dots.1", "key.with.dots.2"), k -> k + "_originalValue"); driver.submitReplacement(mapRef, originalMapValue); assertCorrectBoskContents(); - MapValue newMapValue = originalMapValue.with("key.with.dots.1", "newValue"); + MapValue newMapValue = originalMapValue.with("key.with.dots.1", "_newValue"); driver.submitReplacement(mapRef, newMapValue); assertCorrectBoskContents(); @@ -527,6 +527,7 @@ static Stream childID() { "id.with.dots", "id/with/slashes", "$id$with$dollars$", + "id:with:colons:", AWKWARD_ID, "idWithEmojis\uD83C\uDF33\uD83E\uDDCA" ).map(Identifier::from); @@ -535,7 +536,7 @@ static Stream childID() { /** * Contains all kinds of special characters */ - public static final String AWKWARD_ID = "$id.with%everything/ +\uD83D\uDE09"; + public static final String AWKWARD_ID = "$id.with%everything:/ +\uD83D\uDE09"; @SuppressWarnings("unused") static Stream testEntityField() {