on master help sign in
Add good compiler test for issue #894.
commitbbf5471c4c5ec896b9a3c574b0b470976e072373 authorLaszlo Pandy <laszlo.pandy@prezi.com> dateMon 26 Oct 2015, 16:04 (11 years ago) parent351ac4d
2 files changed+26
tests/test-files/good-expected-js/CodeGenBugs/CommentInterpretedAsInfix.elm.js+14 tests/test-files/good/CodeGenBugs/CommentInterpretedAsInfix.elm+12
tests/test-files/good-expected-js/CodeGenBugs/CommentInterpretedAsInfix.elm.jsnew file+14
@@ -0,0 +1,14 @@
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 always = F2(function (x,s) { return x;});
9+ _op["|>"] = F2(function (a,f) { return f(a);});
10+ var value = A2(_op["|>"],"Hi",always("Hello"));
11+ return _elm.Main.values = {_op: _op
12+ ,always: always
13+ ,value: value};
14+};
tests/test-files/good/CodeGenBugs/CommentInterpretedAsInfix.elmnew file+12
@@ -0,0 +1,12 @@
1+
2+-- Issue: https://github.com/elm-lang/elm-compiler/issues/894
3+-- Two dashes immediately follow by other symbols are incorrectly
4+-- interpreted as an infix operator, instead of a comment.
5+
6+(|>) a f = f a
7+
8+always x s = x
9+
10+value = "Hi"
11+ |> always "Hello"
12+ --|> always "Bye"