Test bin

This page is for E implementation conformance tests for which a more specific location has not yet been found.

How User:Kevin Reid thinks doc-comments ought to work
(1 outside space is dropped, function obj doc goes on the method)

? /** foo */ def x {} ? x.__getAllegedType.getDocComment ? /** foo */ def y :void {} ? y.__getAllegedType.getDocComment ? y.__getAllegedType.getMessageTypes["run/0"].getDocComment
 * 1) value: 
 * 1) value: "foo"
 * 1) value: 
 * 1) value: ""
 * 1) value: "foo"

Trailing commas
Trailing commas should be consistently accepted everywhere (aren't in map-patterns): ? __identityFunc(1,) ? [1,] ? [1 => 2,] ? [null, true, false][1,] ? def [a,] := [1] ? def foo(a,) :void {}
 * 1) value: 1
 * 1) value: [1]
 * 1) value: [1 => 2]
 * 1) value: true
 * 1) value: [1]
 * 1) value:

Expansion of multiple try-catch
? try { throw("oops") } catch ==1 {} ? try { throw("oops") } catch ==1 {} catch ==2 {} That is, none of the patterns matching should be equivalent to a single catch not matching (Fails in EoJ 0.9.1b)
 * 1) problem: oops
 * 1) problem: oops

Expansion of bare try
? def x := 1; try { def x := 2 }; x
 * 1) value: 1

General  should expand to a HideExpr for the sake of scoping if there are no clauses. (Currently fails in E-on-CL.)

Expansion of bind
? def x ? bind x {} ? x.__getAllegedType.getFQName
 * 1) value: 
 * 1) value: 
 * 1) value: "__main$x"

Expansion of map pattern
? def a := "43" ? def b :int := a ? def [b :int] := [a] ? def ["" => b :int] := ["" => a] ? def ["x" => _] := ["" => a]
 * 1) value: "43"
 * 1) problem: 
 * 1) problem: 
 * 1) problem: 
 * 1) problem: x not found

Serialization
? pragma.syntax("0.9") > pragma.enable("accumulator") ? def makeSurgeon :=  ? def surgeons := ["default" => makeSurgeon, "src" => makeSurgeon.withSrcKit(null)] ? def check(x, ignore) { >  def diffs := accum [].asMap for k => surgeon in surgeons { _.with(k, >     def y := surgeon.unserialize(surgeon.serialize(x)) >     accum [] for check ? (!ignore.contains(check)) => r ? (!r) in [ >       "same"  => x == y, >       "equiv" => !x.__respondsTo("compareTo",1) || x <=> y, >       "print" => E.toString(x) == E.toString(y) >     ] { _.with([check, x, y]) } >   )} >  return accum [].asMap for k => v ? (v !~ []) in diffs { _.with(k, v) } > } ? check(1, []) ? check([1,2,3], []) ? check(def x := [1,2,x], []) ? check(Guard, []) ? check(78452960457820936578390758342950673284590431267589324057832946723148963275893465783049856783294507632894506732158912365478567145683415063127849561839450768239032675890432675843294067538490576382590432764589320457832940732849507324893076849051326758903426758903265748329405678329056732895032764853290576438259063278590267589023157689023456784321905632748950634278590342675893214056732841095673214850934726589032467583904576823904561758463859340758329067430642891467389027548790365783567438567473287237458763289478945137536498671236478658920786905234876435187903524783452608079342580796345218076953410876913458079634512087963451208796345017890493578108793452107893451289073452178960345179802879345178693451025734689012768059341278695134278906543210453780216978690543214532786091453782619054386719023452187690134528076931248570691578034629132076845932145768032104657834521780690786934512673845120978603459123456712809341572680931457086293457806219, []) ? check([].diverge, ["same"])
 * 1) value: 
 * 1) value: ["default" =>, "src" => ]
 * 1) value:
 * 1) value: [].asMap
 * 1) value: [].asMap
 * 1) value: [].asMap
 * 1) value: [].asMap
 * 1) value: [].asMap
 * 1) value: [].asMap

???
? E.toString(help(/** FOO */ def _{})).indexOf("FOO") != -1
 * 1) value: true

Behavior of __getAllegedType on objects with non-general matchers
? def _ {}.__getAllegedType ? def _ { match _ {} }.__getAllegedType ? def _ { match [] {} }.__getAllegedType ? require.__getAllegedType
 * 1) value: _
 * 1) value: _
 * 1) value: _
 * 1) value: require0

Processing __N should be idempotent
? def foos := ["a", "b"] ? e`def [foo__1, foo__2] := foos` ? e__quasiParser(e`def [foo__1, foo__2] := foos`.asText) \ >            =~ e`def [foo__1, foo__2] := foos` ? def [foo__1, foo__2] := foos; null ? [=> foo__1, => foo__2] ? meta.getState["&foo__1"].getValue
 * 1) value: e`def [foo__1, foo__2] := foos`
 * 1) value: true
 * 1) value: ["foo__1" => "a", "foo__2" => "b"]
 * 1) value: "a"

This used to hang on E-on-Java
? def T := nullOk[Tuple[any, T]]
 * 1) value: nullOk[Tuple[any, <***CYCLE***>]]

These used to reveal pointers on E-on-Java
? [].asMap[] ? 1.0.random
 * 1) problem:  not found>
 * 1) problem: .random/0>

???
? def l := [].diverge(char) ? l.append(['a', 'b', 'c']) ? l
 * 1) value: [].diverge
 * 1) value: ['a', 'b', 'c'].diverge

This used to fail to be rejected in E-on-Java
? { x + 1; def x := 2 } ? {[x + 1, def x := 2]} As of 0.8.30d, the results of these were: # value: 2 # value: [485, 2]
 * 1) problem: Failed: Undefined variable: x
 * 1) problem: Failed: Undefined variable: x

Miranda messages should not expose Java typed names
? def obj { >  to __getAllegedType :any { return null.__getAllegedType } > } ? obj.__getAllegedType ? [obj."__getAllegedType"]
 * 1) value:
 * 1) value: void
 * 1) problem: 