-
Notifications
You must be signed in to change notification settings - Fork 32
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
jest testing / readme update #45
Open
Anzumana
wants to merge
9
commits into
sidorares:master
Choose a base branch
from
Anzumana:node-vim-debugger
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4d38d32
jest testing / readme update
Anzumana 685cdb1
update readme contributor table
Anzumana 9930c2c
added example for testing the debugger
Anzumana 99a222e
sketch logo design files and png export
Anzumana c64f3e3
update todo.txt
Anzumana 73feff1
faq md file
Anzumana aaea0e0
update todo.txt with all contributors link
Anzumana f305eec
added docs folder
Anzumana ede9e2d
update readme
Anzumana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,3 +1,42 @@ | ||||||
# !Please Read! | ||||||
|
||||||
In node 7.7 release the api for the debugger changed and we did not yet mangage to update the plugin accordingly | ||||||
In order for this plugin to work use 7.6 version of node get it from [npm][npm] | ||||||
If you don't want to configure nvm to work with the debugger or your affraid you could break your current setup, | ||||||
just download the binary to your desktop. | ||||||
```bash | ||||||
~/Desktop/node-v7.6.0-darwin-x64/bin/node --debug-brk examples/qqq.js | ||||||
``` | ||||||
You could put an alias into your zshrc/bashrc/fishrc | ||||||
This alias works assuming you put the node file you downloaded from [npm][npm] onto your desktop | ||||||
If you want to place it somewhere else update the path accordingly | ||||||
```bash | ||||||
alias node7.6="~/Desktopnode-v7.6.0-darwin-x64/bin/node --debug-brk" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
If this does not work for you please consider to open an issue , join our [slack][slack] chatroom or talk to us on twitter and ask your question there. | ||||||
We are always happy to help. | ||||||
|
||||||
# Test Coverage | ||||||
|
||||||
| User | Platform | Status | | ||||||
|---|---|---| | ||||||
| Mac OS X 10.12.6 Node 7.6 Vim 8.0| [Anzumana](https://github.com/anzumana) | + | ||||||
| Linux Node Node 6.2 Vim 8.0 |User | + | | ||||||
| Linux Node Node 6.2 Neovim 0.2.2 |User | - | | ||||||
|
||||||
# Contributors | ||||||
|
||||||
| User | Code | Docs | Continuous Integration | Testing | Test Coverage | | ||||||
| --- | --- | --- | | ||||||
|[sidorales](https://github.com/sidorares)| ʘ‿ʘ |ʘ‿ʘ| | ||||||
|[anzumana](https://github.com/anzumana)||ʘ‿ʘ| | ||||||
|[baopham](https://github.com/baopham)||ʘ‿ʘ| | ||||||
|[coderofsalvation](https://github.com/coderofsalvation)||ʘ‿ʘ| | ||||||
|[gitter-badger](https://github.com/gitter-badger)||ʘ‿ʘ| | ||||||
|[mynameiscoffey](https://github.com/mynameiscoffey)||ʘ‿ʘ| | ||||||
|[adambiggs](https://github.com/adambiggs)||ʘ‿ʘ| | ||||||
|[bitdeli-chef](https://github.com/bitdeli-chef)||ʘ‿ʘ| | ||||||
|
||||||
[](https://flattr.com/submit/auto?user_id=sidorares&url=https://github.com/sidorares/node-vim-debugger&title=node-vim-debugger&language=&tags=github&category=software) | ||||||
|
||||||
node-vim-debugger | ||||||
|
@@ -160,3 +199,8 @@ Move up one stack frame. | |||||
- [ndb](https://github.com/smtlaissezfaire/ndb) | ||||||
- [node-profiler](https://github.com/bnoordhuis/node-profiler) | ||||||
- [v8.log processor](https://github.com/sidorares/node-tick) | ||||||
|
||||||
[gitter]: https://badges.gitter.im/Join | ||||||
[slack]: https://javascriptvimdebugger.slack.com/ | ||||||
[npm]: https://nodejs.org/dist/v7.6.0/ | ||||||
[testing_breakpoints]: docs/testing.md#SetBreakpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This road map is in no way set in stone for now its just a collection of things that we stil want to do. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Integrationtests | ||
|
||
#### vim.keys.break | ||
|
||
Add a breakpoint at current line and column. | ||
|
||
#### vim.keys.continue | ||
|
||
Resume program execution until the next breakpoint is encountered, or the program terminates. | ||
|
||
#### vim.keys.down | ||
|
||
Move down one stack frame. | ||
|
||
#### vim.keys.in | ||
|
||
Step inside the current statement's execution. | ||
|
||
#### vim.keys.next | ||
|
||
Step to the next statement. | ||
|
||
#### vim.keys.out | ||
|
||
Step out of the current statement. | ||
|
||
#### vim.keys.up | ||
|
||
Move up one stack frame. | ||
|
||
|
||
# Unit Tests | ||
|
||
# EndToEnd Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,296 @@ | ||
var result=[]; | ||
var result2= []; | ||
//--------------------------------------- | ||
// Data definition | ||
//--------------------------------------- | ||
class Card { | ||
constructor(left,right,top,bottom) { | ||
this._left = left; | ||
this._right = right; | ||
this._top= top; | ||
this._bottom = bottom; | ||
} | ||
get right(){ | ||
return this._right; | ||
} | ||
set right(value){ | ||
this._right = value; | ||
} | ||
get left(){ | ||
return this._left; | ||
} | ||
set left(value){ | ||
this._left = value; | ||
} | ||
get top(){ | ||
return this._top; | ||
} | ||
set top(value){ | ||
this._top = value; | ||
} | ||
get bottom(){ | ||
return this._bottom; | ||
} | ||
set bottom(value){ | ||
this._bottom = value; | ||
} | ||
} | ||
Card.prototype.toString = function dogToString() { | ||
var convert = function convert(number){ | ||
const blueFront = 11; | ||
const blueBack = -11; | ||
const purpleFront = 12; | ||
const purpleBack = -12; | ||
const grayFront = 15; | ||
const grayBack = -15; | ||
const redFront = 16; | ||
const redBack = -16; | ||
switch(number){ | ||
case blueFront : | ||
return 'blueFront'; | ||
case blueBack: | ||
return 'blueBack'; | ||
case purpleFront: | ||
return 'purpleFront'; | ||
case purpleBack: | ||
return 'purpleBack'; | ||
case grayFront: | ||
return 'grayFront'; | ||
case grayBack: | ||
return 'grayBack'; | ||
case redFront: | ||
return 'redFront'; | ||
case redBack: | ||
return 'redBack'; | ||
default: | ||
return "error in element"; | ||
} | ||
} | ||
var result = '(' + this.left + ' ' + this.right + ' ' + this.top + ' ' + this.bottom + ')'; | ||
return result; | ||
} | ||
class Game { | ||
constructor(cardsArray) { | ||
this.cards=cardsArray; | ||
} | ||
} | ||
|
||
|
||
//--------------------------------------- | ||
// Function Defintions | ||
//--------------------------------------- | ||
/** | ||
* Rotate the card clockwise (to the right ) | ||
* @param card | ||
* | ||
*/ | ||
function rotateCard(card,j){ | ||
//console.log('rotateCard'); | ||
//console.log(card); | ||
var tmp = Object.assign({},card); | ||
|
||
switch (j){ | ||
case 0: | ||
return card; | ||
case 1: | ||
card.top = tmp.left; | ||
card.right = tmp.top; | ||
card.bottom = tmp.right; | ||
card.left = tmp.bottom; | ||
return card; | ||
case 2: | ||
card.right = tmp.left; | ||
card.bottom = tmp.top; | ||
card.left = tmp.right; | ||
card.top = tmp.bottom; | ||
return card; | ||
case 3: | ||
card.bottom = tmp.left; | ||
card.left = tmp.top; | ||
card.top = tmp.right; | ||
card.right = tmp.bottom; | ||
return card; | ||
default: | ||
return card; | ||
} | ||
} | ||
//print each array permutation of the game array | ||
/** | ||
* returns an array that contains every permutation of our game array | ||
* @param game array initial game array | ||
* @return array containing every permuation of the game array | ||
* | ||
*/ | ||
function print(array, n){ | ||
if(array.length==1) { | ||
//return n.push(array[0]); | ||
//var tmp = n.slice(); | ||
//tmp.push(array[0]); | ||
//result.push(tmp); | ||
//return result.push(n.push(array[0])); | ||
//var arr3 = n | ||
//console.log(n); | ||
//return result.push(n); | ||
//var tmp = n.concat(array); | ||
//result.push(tmp); | ||
result.push(n.concat(array[0])); | ||
//result.push(array[0]); | ||
return ; | ||
|
||
//return result.push(n + "," + array[0]+ "this"); | ||
//result.push(n); | ||
//return result.push(n,array[0]); | ||
//return result.push(array[0]); | ||
} | ||
for(var i = 0;i<array.length;i++){ | ||
var oldValue = []; | ||
if(n!==undefined){ | ||
oldValue =oldValue.concat(n); | ||
} | ||
var tmp = array.slice(); | ||
var tmp2 = tmp.splice(i,1); | ||
//oldValue.push(tmp.splice(i,1)); | ||
oldValue.push(tmp2[0]); | ||
//console.log(tmp); | ||
//console.log(oldValue); | ||
print(tmp, oldValue); | ||
} | ||
} | ||
/** | ||
* | ||
* | ||
*/ | ||
function rotate(array,n){ | ||
if(array.length==1) { | ||
//if(array[0]== undefined){ | ||
//return result2.push(n); | ||
return console.log(n + "," + array[0]); | ||
//} | ||
//return result2.push(n.concat(array[0])); | ||
} | ||
for(var i = 0;i<array.length;i++){ | ||
for(var j =0;j<4;j++){ | ||
var oldValue = []; | ||
if(n!==undefined){ | ||
oldValue.push(n); | ||
} | ||
var tmp = array.slice(); | ||
oldValue.push(rotateCard(tmp[i],j)); | ||
tmp.splice(i,1); | ||
rotate(tmp, oldValue); | ||
} | ||
} | ||
} | ||
function fact(x){ | ||
if(x==1) { return 1;} | ||
return x*fact(x-1); | ||
} | ||
/** | ||
* Checks if the game was solved and all card are in the | ||
* right places | ||
* @param game | ||
* @return bool | ||
* | ||
*/ | ||
function checkSolution(game){ | ||
console.log('==============='); | ||
//console.log(game); | ||
console.time('checkSolution'); | ||
// check left column | ||
if( (game[0].right+game[1].left != 0) || (game[0].bottom+game[3].top != 0) ) return false; | ||
if( (game[3].right+game[4].left != 0) || (game[3].bottom+game[6].top != 0) ) return false; | ||
if( (game[6].right+game[7].left != 0) ) return false; | ||
|
||
// check middle column | ||
if( (game[1].right+game[2].left != 0) || (game[1].bottom+game[4].top != 0) ) return false; | ||
if( (game[4].right+game[5].left != 0) || (game[4].bottom+game[7].top != 0) ) return false; | ||
if( (game[7].right+game[8].left != 0) ) return false; | ||
// check right column | ||
if( (game[2].bottom+game[5].top != 0) ) return false; | ||
if( (game[5].bottom+game[8].top != 0) ) return false; | ||
console.log('Solution correct'); | ||
console.log(game); | ||
solved=true; | ||
return true; | ||
console.timeEnd('checkSolution'); | ||
} | ||
|
||
function main(){ | ||
const blueFront = 11; | ||
const blueBack = -11; | ||
const purpleFront = 12; | ||
const purpleBack = -12; | ||
const grayFront = 15; | ||
const grayBack = -15; | ||
const redFront = 16; | ||
const redBack = -16; | ||
var soluion = []; | ||
var solved = false; | ||
console.log('Knobel Calculations'); | ||
console.log('x x x'); | ||
console.log('x x x'); | ||
console.log('x x x'); | ||
//console.log(game); | ||
|
||
var card0= new Card(grayFront, blueBack, redBack, purpleFront); | ||
var card1= new Card(purpleFront, blueBack, redFront, grayBack); | ||
var card2 = new Card(purpleFront, purpleBack, grayFront, blueBack); | ||
|
||
var card3 = new Card(blueFront, grayBack, purpleBack, redFront); | ||
var card4 = new Card(purpleBack, redFront, blueBack, grayFront); | ||
var card5 = new Card(purpleFront , grayBack, blueFront, redBack); | ||
|
||
var card6 = new Card(blueBack, purpleFront, redFront, grayBack); | ||
var card7 = new Card(purpleFront, redBack, grayFront, blueBack); | ||
var card8 = new Card(redFront, redBack, blueFront, grayBack); | ||
|
||
var rotateArray = [card0,card1,card2,card3,card4,card5,card6,card7,card8]; | ||
//var game = new Game(cardsArray); | ||
//console.log(game); | ||
//console.log(fact(4)); | ||
rotateArray= [card0,card1,card0]; | ||
//rotateArray= [1,2,3]; | ||
console.log('this is our array'); | ||
print(rotateArray); | ||
console.log(result); | ||
//console.log(card0); | ||
var test = result[0]; | ||
|
||
//console.log(result[0]); | ||
//console.log('lets roate our testarray'); | ||
//console.log(rotateArray); | ||
//rotate(rotateArray); | ||
//console.log(result2); | ||
//for(var i = 0; i< result.length;i++){ | ||
//result2=[]; | ||
//console.log('starting to rotate array'); | ||
//rotate(result[i]); | ||
//console.log('rotation done'); | ||
//for(var j =0; i<result2.length;j++){ | ||
//console.log(i +" of " +result.length +" " + i/result.length*100+ "% done"); | ||
//if(checkSolution(result[i])){ | ||
//console.log('found result'); | ||
//console.log(result[i]); | ||
//} | ||
//} | ||
//} | ||
|
||
//for(var j = 0 ; j < result2.length; j++){ | ||
//if(checkSolution(result2[j])){ | ||
//return result2[j]; | ||
//}; | ||
//console.log('false'); | ||
//} | ||
//} | ||
//console.log(result2); | ||
//console.log(result2[0]); | ||
//console.log('starting with our check for the entire array'); | ||
//console.log(result2[5]); | ||
return | ||
return 'no solution found'; | ||
} | ||
//--------------------------------------- | ||
// Code Execution | ||
//--------------------------------------- | ||
|
||
console.log(main()); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--debug-brk and --debug are deprecated might want to refactor