Skip to content

Commit

Permalink
Merge pull request #86 from Perlence/fix-none-comparison
Browse files Browse the repository at this point in the history
Python: Fix comparison to None when 'show_unchanged' is set
  • Loading branch information
paulfitz authored Feb 17, 2017
2 parents 773c544 + 7fb1865 commit 6fad17c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions coopy/TableDiff.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,9 @@ class TableDiff {
publish = flags.show_unchanged;
var dummy : Bool = false;
if (out==1) {
publish = active_row[i]>0;
dummy = active_row[i]==3;
var value: Null<Int> = active_row[i];
publish = value!=null && value>0;
dummy = value!=null && value==3;
if (dummy&&showed_dummy) continue;
if (!publish) continue;
}
Expand Down
9 changes: 9 additions & 0 deletions harness/BasicTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,13 @@ class BasicTest extends haxe.unit.TestCase {
"2,green\n");
assertEquals(tab.width,2);
}

public function testShowChanged() {
var table1 = Native.table(data1);
var flags = new coopy.CompareFlags();
flags.show_unchanged = true;
var table = coopy.Coopy.diff(table1,table1,flags);
assertEquals(4,table.height);
assertEquals(3,table.width);
}
}

0 comments on commit 6fad17c

Please sign in to comment.