Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

False positive in collections dccd #1105

Closed
vicb opened this issue Jun 4, 2014 · 1 comment
Closed

False positive in collections dccd #1105

vicb opened this issue Jun 4, 2014 · 1 comment

Comments

@vicb
Copy link
Contributor

vicb commented Jun 4, 2014

[a b c] -> [b a c] would report a move for c

collection: b[1 -> 0], a[0 -> 1], c
previous: a[0 -> 1], b[1 -> 0], c
additions: 
moves: b[1 -> 0], a[0 -> 1], c
removals: 

UT (failing on master):

        it('should not report unnecessary moves', () {
          var list = ['a', 'b', 'c'];
          var record = detector.watch(list, null, null);
          var iterator = detector.collectChanges()..moveNext();

          list..clear()..addAll(['b', 'a', 'c']);
          iterator = detector.collectChanges()..moveNext();
          expect(iterator.current.currentValue, toEqualCollectionRecord(
              collection: ['b[1 -> 0]', 'a[0 -> 1]', 'c'],
              previous: ['a[0 -> 1]', 'b[1 -> 0]', 'c'],
              additions: [],
              moves: ['b[1 -> 0]', 'a[0 -> 1]'],
              removals: []));
        });
@mhevery
Copy link
Contributor

mhevery commented Jun 4, 2014

@vicb That seems wrong, C should be suppressed, so your tests should be passing.

vicb added a commit to vicb/angular.dart that referenced this issue Jun 9, 2014
@vicb vicb closed this as completed in ea3eb1e Jun 9, 2014
@vicb vicb reopened this Jun 9, 2014
@vicb vicb closed this as completed Jun 9, 2014
dsalsbury pushed a commit to dsalsbury/angular.dart that referenced this issue Jul 16, 2014
dsalsbury pushed a commit to dsalsbury/angular.dart that referenced this issue Jul 16, 2014
vicb added a commit that referenced this issue Aug 5, 2014
vicb added a commit that referenced this issue Aug 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants