1package authoring23import "testing"45func TestFeatureValueCoalescesTheFirstPresentScalar(t *testing.T) {6 t.Parallel()7 feature := geoJSONFeature{Properties: map[string]any{8 "NAME": nil,9 "OID": "road-42",10 }}11 value, held := featureValue(feature, "coalesce(properties.NAME, properties.OID)")12 if !held || scalarString(value) != "road-42" {13 t.Fatalf("coalesced value = %v, %v", value, held)14 }15 if _, held := featureValue(feature, "coalesce(properties.NAME)"); held {16 t.Fatal("malformed coalesce expression was accepted")17 }18}