Skip to content

Two-Bucket has an incorrect test #1551

@glennj

Description

@glennj

The number of moves for the 6th test is wrong.

  describe('Measure using bucket one of size 2 and bucket two of size 3', () => {
    xtest('start with bucket one and end with bucket two', () => {
      const twoBucket = new TwoBucket(2, 3, 3, 'one');
      expect(twoBucket.moves()).toEqual(4);
      expect(twoBucket.goalBucket).toEqual('two');
      expect(twoBucket.otherBucket).toEqual(1);
    });
  });

The number of moves should be 2:

  1. fill the start bucket
  2. since the other bucket size == the goal, fill it
  3. there is no move 3.

Following that change, the otherBucket amount should be 2 (the start bucket is full).

I humbly suggest my solution as a reference solution.

This was changed in #1396.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions