if {"::tcltest" ni [namespace children]} {
	package require tcltest
	namespace import ::tcltest::*
}

package require rl_json
namespace path {::rl_json}

test exists-1.1 {exists a value from an object} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} foo
} -result 1
#>>>
test exists-2.1 {exists a value from an object} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz
} -result 1
#>>>
test exists-3.1 {exists a value from a nested object} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz": {
				"query": "filtered"
			}
		}
	} baz query
} -result 1
#>>>
test exists-4.1 {exists a value from an array} -body { #<<<
	json exists {["a", "b", "c", "d"]} 2
} -result 1
#>>>
test exists-4.4 {exists an index from an array relative to the end} -body { #<<<
	json exists {["a", "b", "c", "d"]} end
} -result 1
#>>>
test exists-4.5 {exists an index from an array relative to the end} -body { #<<<
	json exists {["a", null, "c", "d"]} end-2
} -result 1
#>>>
test exists-4.6 {exists an index from an array relative to the end} -body { #<<<
	json exists {["a", "b", "c", "d"]} end-4
} -result 0
#>>>
test exists-5.1 {exists a value from an array in an object} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 2
} -result 1
#>>>
test exists-6.1 {exists of a toplevel value} -body { #<<<
	# Note - should not be normalized
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	}
} -result 1
#>>>
test exists-7.1 {exists for invalid value - empty string} -body { #<<<
	json exists {} foo
} -result 0
#>>>
test exists-7.2 {exists for invalid value - truncated object} -body { #<<<
	json exists "\{\"foo\":\"bar\"" foo
} -result 0
#>>>
test exists-7.3 {exists for invalid value - truncated array} -body { #<<<
	json exists {["foo", "bar"} 1
} -result 0
#>>>
test exists-7.4 {exists for invalid value - truncated string} -body { #<<<
	json exists {"foo} foo
} -result 0
#>>>
test exists-7.5 {exists for invalid value - truncated boolean: true} -body { #<<<
	json exists {tru} foo
} -result 0
#>>>
test exists-7.6 {exists for invalid value - truncated boolean: false} -body { #<<<
	json exists {fals} foo
} -result 0
#>>>
test exists-7.7 {exists for invalid value - truncated null} -body { #<<<
	json exists {nul} foo
} -result 0
#>>>

# Modifiers - ?type
test exists-20.1 {type modifier, string} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} foo ?type
} -result 1
#>>>
test exists-20.2 {type modifier, array} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz ?type
} -result 1
#>>>
test exists-20.3 {type modifier, number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 1 ?type
} -result 1
#>>>
test exists-20.4 {type modifier, boolean} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 3 ?type
} -result 1
#>>>
test exists-20.5 {type modifier, null} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 5 ?type
} -result 1
#>>>
test exists-20.6 {type modifier, object} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 6 ?type
} -result 1
#>>>
test exists-20.7 {type modifier, template subst: string} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~S:dynamic"
		}
	} something ?type
} -result 1
#>>>
test exists-20.8 {type modifier, template subst: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~N:dynamic"
		}
	} something ?type
} -result 1
#>>>
test exists-20.9 {type modifier, template subst: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~B:dynamic"
		}
	} something ?type
} -result 1
#>>>
test exists-20.10 {type modifier, template subst: literal} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~L:dynamic"
		}
	} something ?type
} -result 1
#>>>
test exists-20.11 {type modifier, template subst: json doc} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~J:dynamic"
		}
	} something ?type
} -result 1
#>>>
test exists-20.12 {type modifier, template subst: json template} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~T:dynamic"
		}
	} something ?type
} -result 1
#>>>
test exists-20.13 {type modifier, template subst: invalid} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~X:dynamic"
		}
	} something ?type
} -result 1
#>>>

# Modifiers - ?length
test exists-21.1 {length modifier, string} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} foo ?length
} -result 1
#>>>
test exists-21.2 {length modifier, array} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz ?length
} -result 1
#>>>
test exists-21.3 {length modifier, number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 1 ?length
} -result 0
#>>>
test exists-21.4 {length modifier, boolean} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 3 ?length
} -result 0
#>>>
test exists-21.5 {length modifier, null} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 5 ?length
} -result 0
#>>>
test exists-21.6 {length modifier, object} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 6 ?length
} -result 0
#>>>
test exists-21.7 {length modifier, template subst: string} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~S:dynamic"
		}
	} something ?length
} -result 1
#>>>
test exists-21.8 {length modifier, template subst: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~N:dynamic"
		}
	} something ?length
} -result 1
#>>>
test exists-21.9 {length modifier, template subst: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~B:dynamic"
		}
	} something ?length
} -result 1
#>>>
test exists-21.10 {length modifier, template subst: literal} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~L:dynamic"
		}
	} something ?length
} -result 1
#>>>
test exists-21.11 {length modifier, template subst: json doc} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~J:dynamic"
		}
	} something ?length
} -result 1
#>>>
test exists-21.12 {length modifier, template subst: json template} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~T:dynamic"
		}
	} something ?length
} -result 1
#>>>
test exists-21.13 {length modifier, template subst: invalid} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~X:dynamic"
		}
	} something ?length
} -result 1
#>>>

# Modifiers - ?size
test exists-22.1 {size modifier, string} -body { #<<<
	json exists {
		{
			"foo": "bar x",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} foo ?size
} -result 0
#>>>
test exists-22.2 {size modifier, array} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz ?size
} -result 0
#>>>
test exists-22.3 {size modifier, number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 1 ?size
} -result 0
#>>>
test exists-22.4 {size modifier, boolean} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 3 ?size
} -result 0
#>>>
test exists-22.5 {size modifier, null} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 5 ?size
} -result 0
#>>>
test exists-22.6 {size modifier, object} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj", "x": "y", "z": null}]
		}
	} baz 6 ?size
} -result 1
#>>>
test exists-22.7 {size modifier, template subst: string} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~S:dynamic"
		}
	} something ?size
} -result 0
#>>>
test exists-22.8 {size modifier, template subst: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~N:dynamic"
		}
	} something ?size
} -result 0
#>>>
test exists-22.9 {size modifier, template subst: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~B:dynamic"
		}
	} something ?size
} -result 0
#>>>
test exists-22.10 {size modifier, template subst: literal} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~L:dynamic"
		}
	} something ?size
} -result 0
#>>>
test exists-22.11 {size modifier, template subst: json doc} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~J:dynamic"
		}
	} something ?size
} -result 0
#>>>
test exists-22.12 {size modifier, template subst: json template} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~T:dynamic"
		}
	} something ?size
} -result 0
#>>>
test exists-22.13 {size modifier, template subst: invalid} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~X:dynamic"
		}
	} something ?size
} -result 0
#>>>

# Modifiers - ?keys
test exists-23.1 {keys modifier, string} -body { #<<<
	json exists {
		{
			"foo": "bar x",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} foo ?keys
} -result 0
#>>>
test exists-23.2 {keys modifier, array} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz ?keys
} -result 0
#>>>
test exists-23.3 {keys modifier, number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 1 ?keys
} -result 0
#>>>
test exists-23.4 {keys modifier, boolean} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 3 ?keys
} -result 0
#>>>
test exists-23.5 {keys modifier, null} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}]
		}
	} baz 5 ?keys
} -result 0
#>>>
test exists-23.6 {keys modifier, object} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj", "x": "y", "z": null}]
		}
	} baz 6 ?keys
} -result 1
#>>>
test exists-23.7 {keys modifier, template subst: string} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~S:dynamic"
		}
	} something ?keys
} -result 0
#>>>
test exists-23.8 {keys modifier, template subst: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~N:dynamic"
		}
	} something ?keys
} -result 0
#>>>
test exists-23.9 {keys modifier, template subst: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~B:dynamic"
		}
	} something ?keys
} -result 0
#>>>
test exists-23.10 {keys modifier, template subst: literal} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~L:dynamic"
		}
	} something ?keys
} -result 0
#>>>
test exists-23.11 {keys modifier, template subst: json doc} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~J:dynamic"
		}
	} something ?keys
} -result 0
#>>>
test exists-23.12 {keys modifier, template subst: json template} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~T:dynamic"
		}
	} something ?keys
} -result 0
#>>>
test exists-23.13 {keys modifier, template subst: invalid} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": "~X:dynamic"
		}
	} something ?keys
} -result 0
#>>>

test exists-50.1 {escaping a modifier} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} something ??type
} -result 1
#>>>

# Invalid paths
test exists-60.1 {invalid path: missing key} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} blah
} -result 0
#>>>
test exists-60.2 {invalid path: subscribed atomic: string} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} foo blah
} -result 0
#>>>
test exists-60.3 {invalid path: subscribed atomic: number} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz 1 blah
} -result 0
#>>>
test exists-60.4 {invalid path: subscribed atomic: boolean} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz 3 blah
} -result 0
#>>>
test exists-60.5 {invalid path: subscribed atomic: null} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz 5 blah
} -result 0
#>>>
test exists-60.6 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz blah
} -returnCodes error -result {Expected an integer index or end(-integer)?, got blah}
#>>>
test exists-60.7 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz end-12
} -result 0
#>>>
test exists-60.8 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz 100
} -result 0
#>>>
test exists-60.9 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz -2
} -result 0
#>>>
test exists-60.10 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz end-2foo
} -returnCodes error -result {Expected an integer index or end(-integer)?, got end-2foo}
#>>>
test exists-60.11 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz end-foo
} -returnCodes error -result {Expected an integer index or end(-integer)?, got end-foo}
#>>>
test exists-60.12 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz end2
} -returnCodes error -result {Expected an integer index or end(-integer)?, got end2}
#>>>
test exists-60.13 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz end+2
} -returnCodes error -result {Expected an integer index or end(-integer)?, got end+2}
#>>>
test exists-60.14 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz "end- 2"
} -returnCodes error -result {Expected an integer index or end(-integer)?, got end- 2}
#>>>
test exists-60.15 {invalid path: invalid array index} -body { #<<<
	json exists {
		{
			"foo": "bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} baz end-
} -returnCodes error -result {Expected an integer index or end(-integer)?, got end-}
#>>>
test exists-60.16 {invalid path: subscribed atomic: template string} -body { #<<<
	json exists {
		{
			"foo": "~S:bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} foo blah
} -result 0
#>>>
test exists-60.17 {invalid path: subscribed atomic: template number} -body { #<<<
	json exists {
		{
			"foo": "~N:bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} foo blah
} -result 0
#>>>
test exists-60.18 {invalid path: subscribed atomic: template boolean} -body { #<<<
	json exists {
		{
			"foo": "~B:bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} foo blah
} -result 0
#>>>
test exists-60.19 {invalid path: subscribed atomic: template json doc} -body { #<<<
	json exists {
		{
			"foo": "~J:bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} foo blah
} -result 0
#>>>
test exists-60.20 {invalid path: subscribed atomic: template json template} -body { #<<<
	json exists {
		{
			"foo": "~T:bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} foo blah
} -result 0
#>>>
test exists-60.21 {invalid path: subscribed atomic: template literal} -body { #<<<
	json exists {
		{
			"foo": "~L:bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} foo blah
} -result 0
#>>>
test exists-60.22 {invalid path: subscribed atomic: template invalid} -body { #<<<
	json exists {
		{
			"foo": "~X:bar",
			"baz":  ["str", 123, 123.4, true, false, null, {"inner": "obj"}],
			"something": {
				"?type": "fromdoc"
			}
		}
	} foo blah
} -result 0
#>>>

::tcltest::cleanupTests
return

# vim: ft=tcl foldmethod=marker foldmarker=<<<,>>> ts=4 shiftwidth=4
