16 failures
This commit is contained in:
parent
18a5831514
commit
aab41d6fba
|
@ -51,7 +51,7 @@ See `kitchen_sink.sh` examples.
|
||||||
- [X] Update Ruby API docs
|
- [X] Update Ruby API docs
|
||||||
- [X] Update blobs spec to clear out blob folder every time it runs.
|
- [X] Update blobs spec to clear out blob folder every time it runs.
|
||||||
- [ ] Oops, `lipmaa` field needs to be a hash, not an integer!
|
- [ ] Oops, `lipmaa` field needs to be a hash, not an integer!
|
||||||
- [ ] Change draft and message templates to render headers in this order: `author`, `prev`, `lipmaa`, `kind`, `depth`.
|
- [ ] Change draft and message templates to render headers in this order: `author`, `prev`, `lipmaa`, `depth`, `kind`.
|
||||||
- [ ] Make location of blob folder configurable?
|
- [ ] Make location of blob folder configurable?
|
||||||
- [ ] Update Dev docs in protocol spec to reflect changes to `lipmaa` header.
|
- [ ] Update Dev docs in protocol spec to reflect changes to `lipmaa` header.
|
||||||
- [ ] Update spec document CLI usage examples to reflect API changes in 2020.
|
- [ ] Update spec document CLI usage examples to reflect API changes in 2020.
|
||||||
|
|
|
@ -89,7 +89,9 @@ module Pigeon
|
||||||
# The original lipmaa function returns -1 for 0
|
# The original lipmaa function returns -1 for 0
|
||||||
# but that does not mesh well with our serialization
|
# but that does not mesh well with our serialization
|
||||||
# scheme. Comments welcome on this one.
|
# scheme. Comments welcome on this one.
|
||||||
return 0 if n < 1 # Prevent -1, division by zero etc..
|
if n < 1 # Prevent -1, division by zero etc..
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
m, po3, x = 1, 3, n
|
m, po3, x = 1, 3, n
|
||||||
# find k such that (3^k - 1)/2 >= n
|
# find k such that (3^k - 1)/2 >= n
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
RSpec.describe Pigeon::Helpers do
|
RSpec.describe Pigeon::Helpers do
|
||||||
it "creates lipmalinks" do
|
it "creates lipmalinks" do
|
||||||
[
|
[
|
||||||
[-1, 0],
|
[-1, nil],
|
||||||
[0, 0],
|
[0, nil],
|
||||||
[1, 0],
|
[1, nil],
|
||||||
[2, 1],
|
[2, nil],
|
||||||
[3, 2],
|
[3, nil],
|
||||||
[4, 1],
|
[4, 1],
|
||||||
[5, 4],
|
[5, nil],
|
||||||
[6, 5],
|
[6, nil],
|
||||||
[7, 6],
|
[7, nil],
|
||||||
[8, 4],
|
[8, 4],
|
||||||
[13, 4],
|
[13, 4],
|
||||||
].map do |(input, expected)|
|
].each do |(input, expected)|
|
||||||
actual = Pigeon::Helpers.lipmaa(input)
|
expect(Pigeon::Helpers.lipmaa(input)).to eq(expected)
|
||||||
expect(actual).to eq(expected)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue