Skip to content

Commit

Permalink
updated testcases, fixes #306
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Apr 6, 2019
1 parent 2e2d672 commit 0fef341
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 11 deletions.
11 changes: 6 additions & 5 deletions test/testcases/sameline/issue_306_case_bropen_keep.hxtest
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"wrapping": {
"maxLineLength": 1600
"maxLineLength": 1600,
"objectLiteral": {
"defaultWrap": "keep"
}
},
"sameLine": {
"caseBody": "keep",
Expand All @@ -14,8 +17,7 @@ class Main {
public static function main() {
switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}
case {name: name, kind: FVar(AccCall, AccCall)}
: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
Expand All @@ -28,8 +30,7 @@ class Main {
}
return switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}:
case {name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"wrapping": {
"maxLineLength": 1600,
"objectLiteral": {
"defaultWrap": "keep"
}
},
"sameLine": {
"caseBody": "keep",
"expressionCase": "keep"
},
"lineEnds": {
"leftCurly": "both"
}
}

---

class Main {
public static function main() {
switch f
{
case {name: name, kind: FVar(AccCall, AccCall)}
: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}
: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
return switch f
{
case {name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
return switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
}
}

---

class Main
{
public static function main()
{
switch f
{
case {name: name, kind: FVar(AccCall, AccCall)}: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
return switch f
{
case {name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
return switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
}
}
32 changes: 29 additions & 3 deletions test/testcases/sameline/issue_306_case_bropen_next.hxtest
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,32 @@ class Main {
public static function main() {
switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}
case {name: name, kind: FVar(AccCall, AccCall)}
: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
return switch f
switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}
: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
return switch f
{
case {name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
return switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
}
}

Expand All @@ -39,6 +53,18 @@ class Main {
case _:
continue;
}
switch f {
case {name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
return switch f {
case {name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
return switch f {
case {name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
Expand Down
28 changes: 25 additions & 3 deletions test/testcases/sameline/issue_306_case_bropen_same.hxtest
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,32 @@ class Main {
public static function main() {
switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}
case {name: name, kind: FVar(AccCall, AccCall)}
: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
return switch f
switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}
: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
return switch f
{
case {name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
return switch f
{
case
{name: name, kind: FVar(AccCall, AccCall)}:
macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _:
continue;
}
}
}

Expand All @@ -37,6 +51,14 @@ class Main {
case {name: name, kind: FVar(AccCall, AccCall)}: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
switch f {
case {name: name, kind: FVar(AccCall, AccCall)}: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
return switch f {
case {name: name, kind: FVar(AccCall, AccCall)}: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
}
return switch f {
case {name: name, kind: FVar(AccCall, AccCall)}: macro callbacks.push(model.observables.$name.bind({direct: direct}, onPropertyChange.bind($v{name})));
case _: continue;
Expand Down

0 comments on commit 0fef341

Please sign in to comment.