# Copyright 2005-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ? # value: ? .getTYPE() # value: -128..!128 disabled because it takes too long for the test suite x ? def makeSurgeon := x # value: x x ? def surgeon := makeSurgeon.withSrcKit(null) x # value: x x ? surgeon.serialize(1) x # value: "1" ? # value: __makeMap Throwable ? def Throwable := # value: Throwable ? def p := "foo" :Throwable # value: problem: foo ? p :Throwable # value: problem: foo ? {[null =~ nullT :Throwable, &nullT]} # value: [false, ] Runnable ? def Runnable := # value: ? def f() :void {} :Runnable # value: XXX test rejection once we've settled whether it ever does so ' UnQuote ? def makeUnQuote := # value: ? makeUnQuote :DeepFrozen # value: ? def fooUQ := makeUnQuote("foo") # value: foo ? fooUQ :DeepFrozen # value: foo ? fooUQ.__optUncall() # value: [, "run", ["foo"]] Brand/Sealer/Unsealer ? def makeBrand := # value: ? def [sealer, unsealer] := def kit := makeBrand("ACME Widget") # value: ? def brand := kit.getBrand() # value: ACME Widget confirm that __conformTo of the kit is not-broken ? kit.__conformTo(boolean) == kit # value: true ? [sealer, unsealer] # value: [, ] ? sealer.getBrand() == brand # value: true ? unsealer.getBrand() == brand # value: true ? def box := sealer.seal(def widget {}) # value: ? help(box) # value: interface "org.erights.e.elib.sealing.makeBrandAuthor$makeBrandAuthor$makeBrand$sealer$sealedBox" { # /** Return the Brand of the Unsealer which can unseal this box. */ # to getBrand() :any # /** An implementation detail. */ # to _offerContent(k) :any # } ? box.getBrand() == brand # value: true ? {[def r := unsealer.unseal(box), r == widget]} # value: [, true] ? escape not { print("-> ", unsealer.unseal(box, not)) } catch p { print(p) } # stdout: -> ? escape not { print("-> ", unsealer.unseal(44, not)) } catch p { print(p) } # stdout: problem: 44 is not a ACME Widget sealed box XXX wrong-brand boxes XXX wrong-brand/non-boxes to unseal/1 XXX test that one can't mess with _offerContent ' XXX spoof/proxied boxes/unsealers XXX all unseal methods XXX optUncall simplifyFQName ? def simplifyFQName := # value: ? simplifyFQName :DeepFrozen # value: XXX test operation FirstCharSplitter ? def makeFirstCharSplitter :DeepFrozen := # value: ? def abSplitter :DeepFrozen := makeFirstCharSplitter("ab") # value: XXX just testing DeepFrozenness for now