on master help sign in
Get rid of ports tests, no longer work without core
c3b6f4fEvan Czaplicki
tests/test-files/good-expected-js/Declarations/Ports.elm.jsdeleted−49
@@ -1,49 +0,0 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values) return _elm.Main.values;
6− var _U = Elm.Native.Utils.make(_elm);
7− var _op = {};
8− var students = Elm.Native.Port.make(_elm).outbound("students",
9− function (v) {
10− return Elm.Native.List.make(_elm).toArray(v).map(function (v) { return {name: v.name,age: v.age};});
11− },
12− _U.list([{name: "Tom",age: 42}]));
13− var time = Elm.Native.Port.make(_elm).outbound("time",function (v) { return v;},3.14);
14− var fortyTwo = Elm.Native.Port.make(_elm).outbound("fortyTwo",function (v) { return v;},42);
15− var record = Elm.Native.Port.make(_elm).inbound("record",
16− "{ x : Float, y : Float }",
17− function (v) {
18− return typeof v === "object" && "x" in v && "y" in v ? {_: {}
19− ,x: typeof v.x === "number" ? v.x : _U.badPort("a number",v.x)
20− ,y: typeof v.y === "number" ? v.y : _U.badPort("a number",
21− v.y)} : _U.badPort("an object with fields `x`, `y`",v);
22− });
23− var array = Elm.Native.Port.make(_elm).inbound("array",
24− "List Float",
25− function (v) {
26− return typeof v === "object" && v instanceof Array ? Elm.Native.List.make(_elm).fromArray(v.map(function (v) {
27− return typeof v === "number" ? v : _U.badPort("a number",v);
28− })) : _U.badPort("an array",v);
29− });
30− var tuple = Elm.Native.Port.make(_elm).inbound("tuple",
31− "( Float, Bool )",
32− function (v) {
33− return typeof v === "object" && v instanceof Array ? {ctor: "_Tuple2"
34− ,_0: typeof v[0] === "number" ? v[0] : _U.badPort("a number",v[0])
35− ,_1: typeof v[1] === "boolean" ? v[1] : _U.badPort("a boolean (true or false)",
36− v[1])} : _U.badPort("an array",v);
37− });
38− var number = Elm.Native.Port.make(_elm).inbound("number",
39− "Int",
40− function (v) {
41− return typeof v === "number" && isFinite(v) && Math.floor(v) === v ? v : _U.badPort("an integer",v);
42− });
43− var userID = Elm.Native.Port.make(_elm).inbound("userID",
44− "String",
45− function (v) {
46− return typeof v === "string" || typeof v === "object" && v instanceof String ? v : _U.badPort("a string",v);
47− });
48− return _elm.Main.values = {_op: _op};
49−};
tests/test-files/good-expected-js/Declarations/PortsWithTypeAliases.elm.jsdeleted−27
@@ -1,27 +0,0 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values) return _elm.Main.values;
6− var _U = Elm.Native.Utils.make(_elm);
7− var _op = {};
8− var pairs = Elm.Native.Port.make(_elm).inbound("pairs",
9− "Main.Point String String",
10− function (v) {
11− return typeof v === "object" && "x" in v && "y" in v ? {_: {}
12− ,x: typeof v.x === "string" || typeof v.x === "object" && v.x instanceof String ? v.x : _U.badPort("a string",
13− v.x)
14− ,y: typeof v.y === "string" || typeof v.y === "object" && v.y instanceof String ? v.y : _U.badPort("a string",
15− v.y)} : _U.badPort("an object with fields `x`, `y`",v);
16− });
17− var points = Elm.Native.Port.make(_elm).inbound("points",
18− "Main.Point2D",
19− function (v) {
20− return typeof v === "object" && "x" in v && "y" in v ? {_: {}
21− ,x: typeof v.x === "number" ? v.x : _U.badPort("a number",v.x)
22− ,y: typeof v.y === "number" ? v.y : _U.badPort("a number",
23− v.y)} : _U.badPort("an object with fields `x`, `y`",v);
24− });
25− var Point = F2(function (a,b) { return {x: a,y: b};});
26− return _elm.Main.values = {_op: _op,Point: Point};
27−};
tests/test-files/good/Declarations/Ports.elmdeleted−21
@@ -1,21 +0,0 @@
1−
2−-- incoming
3−port userID : String
4−port number : Int
5−port tuple : (Float,Bool)
6−port array : List Float
7−port record : { x:Float, y:Float }
8−
9−-- outgoing
10−port fortyTwo : Int
11−port fortyTwo =
12− 42
13−
14−
15−port time : Float
16−port time =
17− 3.14
18−
19−port students : List { name:String, age:Int }
20−port students =
21− [ { name = "Tom", age = 42 } ]
tests/test-files/good/Declarations/PortsWithTypeAliases.elmdeleted−13
@@ -1,13 +0,0 @@
1−
2−
3−type alias Point2D =
4− Point Float Float
5−
6−type alias Point x y =
7− { x:x, y:y }
8−
9−
10−port points : Point2D
11−
12−
13−port pairs : Point String String