Giter VIP home page Giter VIP logo

coop-fall-2020-challenge's People

Contributors

omasabdullah avatar renonatalizio-ab avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coop-fall-2020-challenge's Issues

Bulk redo()

Hey there,

If the number specified for bulk redo exceeds the number of undos performed, what should the expected output be?

Kind Regards,
Adi

Incorrect assertion in unit tests

In the python tests we have:

def test_redo():
    sourcer = EventSourcer()

    sourcer.add(5)
    sourcer.add(5)
    sourcer.add(5)
    sourcer.undo()
    sourcer.undo()
    sourcer.add(1)
    sourcer.redo()

    assert sourcer.value == 11

Seems like the order goes 0 -> 5 -> 10 -> 15 -> 10 -> 5 -> 6 -> nothing to redo since we added 1 which removed the future. Am I understanding the problem incorrectly?

test_redo

Does not test simple undo redo as explained in video. https://youtu.be/X6NJkWbM1xk?t=219
Once stepped back in time should not be able to redo.

Test fails when it assumes redo should result in output of 11, but instead gets 6.

0 -> (add 5) 5 -> (add 5) 10 -> (add 5) 15 -> (undo) 10 -> (undo) 5 -> (add 1) 6 *future erased, no redo

Clarification Regarding Redoing a Bulk Undo

Hi, assuming we do
bulk_undo(6)
then we do
redo()
does this redo all of the 6 undos we just did, or does it only undo the last 1 out of the 6?

Maybe this was already asked. Sorry if it was.

Thanks in advance

Incorrect test case? - JS

Two things - There seems to be an extra test redo that is just a duplicate of 'test undo'

test('test redo', () => {
  let sourcer = new EventSourcer();

  sourcer.add(2);
  sourcer.add(2);
  sourcer.add(2);
  sourcer.add(2);
  sourcer.undo();

  expect(sourcer.value).toEqual(6);
});

And the actual issue is the real test redo which has an incorrect output value as far as I can tell

test('test redo', () => {
  let sourcer = new EventSourcer();

  sourcer.add(5);
  sourcer.add(5);
  sourcer.add(5);
  sourcer.undo();
  sourcer.undo();
  sourcer.add(1);
  sourcer.redo();

  expect(sourcer.value).toEqual(11);
});

You add to 15, undo to 5, then add 1 to get to 6. The expected output seems to redo the undone 5, but the addition of 1 should be clearing the redo list, making the final output 6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.