Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small patch, better README, areNeighbors() #4

Merged
merged 3 commits into from
Sep 24, 2015

Conversation

possibly
Copy link
Collaborator

  1. Small fix on a function name, it was:
Fixed2DArray.prototype.getColumn = function getRow( ... ){ ... }
  1. README now has better formatting for the forEach method
  2. New function areNeighbours(x1,y1,x2,y2,[, distance]) that will return true or false depending on if the given coordinates are neighbours.

npm run test


> fixed-2d-array@1.1.0 test /Users/tbro/dev/fixed-2d-array
> node test/test.js

TAP version 13
# Default values
ok 1 should be equal
ok 2 should be equal
# getHeight and getWidth
ok 3 should be equal
ok 4 should be equal
# get and set
ok 5 should be equal
# get correct row and column
ok 6 should be equal
ok 7 should be equal
ok 8 should be equal
ok 9 should be equal
ok 10 should throw
ok 11 should throw
# forEach
ok 12 should be equal
# exception on index out of bounds
ok 13 should throw
ok 14 should throw
ok 15 should throw
# get correct number of neighbours
ok 16 should be equal
ok 17 should be equal
ok 18 should be equal
ok 19 should be equal
ok 20 should be equal
ok 21 should be equal
ok 22 should be equal
# areNeighbors
ok 23 (unnamed assert)
ok 24 (unnamed assert)
ok 25 (unnamed assert)
ok 26 should throw
ok 27 should throw
ok 28 should be equal

1..28
# tests 28
# pass  28

# ok

npm run jshint

> fixed-2d-array@1.1.0 jshint /Users/tbro/dev/fixed-2d-array
> jshint test/* lib/*

npm run test-coveralls

> fixed-2d-array@1.1.0 test-coveralls /Users/tbro/dev/fixed-2d-array
> istanbul cover test/test.js  && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage
...
=============================== Coverage summary ===============================
Statements   : 100% ( 64/64 )
Branches     : 100% ( 22/22 )
Functions    : 100% ( 11/11 )
Lines        : 100% ( 62/62 )
================================================================================
...

tillarnold added a commit that referenced this pull request Sep 24, 2015
Small patch, better README, areNeighbors()
@tillarnold tillarnold merged commit 99bfee7 into tillarnold:master Sep 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants