rgrinberg / bencode

Bencode (.torrent file format) reader/writer in OCaml
24 stars 4 forks source link

make Integer backed by int64 to support 32-bit platforms #8

Closed cfcs closed 6 years ago

cfcs commented 6 years ago

I couldn't figure out how to implement a shrinking function for the QCheck test - if someone can point me in the right direction I'll try to fiddle a bit more with that: https://github.com/rgrinberg/bencode/compare/master...cfcs:int64?expand=1#diff-b1435fa88f2ff1f1e9a1b206635197a9R33

resolves https://github.com/rgrinberg/bencode/issues/7

ping @rgrinberg

EDIT: travis-ci test: https://travis-ci.org/cfcs/bencode/builds/381134695 I ran the testsuite locally and that seemed fine, but then again I also changed some things in the test suite, so...

c-cube commented 6 years ago

For the shrinker, you can look at the implem of QCheck.Shrink.int in https://github.com/c-cube/qcheck and also at the shrink_tree example in the readme.

A shrinker for a type 'a is a function 'a -> 'a QCheck.Iter.t (a sequence) which returns any number of smaller items in a lazy fashion.

cfcs commented 6 years ago

@c-cube ah, thanks a lot! I tried to implement that, would you have time to have a look at the change?

cfcs commented 6 years ago

@rgrinberg would you be up for merging this?

rgrinberg commented 6 years ago

Sure. I added you as a collaborator. Feel free to make other improvements and releases.

On Tue, May 29, 2018, 10:25 PM cfcs notifications@github.com wrote:

@rgrinberg https://github.com/rgrinberg would you be up for merging this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rgrinberg/bencode/pull/8#issuecomment-392818725, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIe-4pkCg_EhWbVSJZy8s9Lb_UtdQhdks5t3WhSgaJpZM4UFzVU .

cfcs commented 6 years ago

Thank you! I'm working on a patch to support pretty-printing to a Format.formatter.