Example #1
0
 'has recorded pitch sequence': function(score) {
   assert.deepEqual(score.pitches, [40, 40, 40]);
 },
Example #2
0
 Lazy.range(10, -8).join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(10, -8));
     assert.equal(xs.length, 18);
 });
Example #3
0
 it('returns empty array if no properties requested', function() {
     assert.deepEqual(R.props([], obj), []);
 });
Example #4
0
 Lazy.range('(10..1)').join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(9,1));
     assert.equal(xs.length, 8);
 });
Example #5
0
 Lazy.range('(10..').take(10).join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(11, 21));
     assert.equal(xs.length, 10);
 });
Example #6
0
 Lazy.range('1,1.1..4').join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(1,4,0.1));
     assert.equal(xs.length, 30);
 });
Example #7
0
 Lazy.range('[1..10)').join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(1,10));
     assert.equal(xs.length, 9);
 });
Example #8
0
 it('should ignore block comments in line comments', function(){
   var comments = getCommentsFrom('lineIgnoreBlock.test.scss');
   assert.equal(comments.length, 1);
   assert.deepEqual(comments[0].lines, ['', '/**  test*/', '']);
 });
Example #9
0
 it('should normalize the indentation', function(){
   var comments = getCommentsFrom('lineIndentation.test.scss');
   assert.deepEqual(comments[0].lines, ['', 'test', '   hello', '  world', '']);
 });
Example #10
0
 it('should not split every "*"', function(){
   var comments = getCommentsFrom('blockSplitCorrect.test.scss');
   assert.deepEqual(comments[0].lines, [ '@param {*} $list - list to purge', 'Test', 'Test']);
 });
Example #11
0
 parse : function(line, info, id){
   assert.equal(id, 'FileID');
   assert.deepEqual(info, {"description":"","commentRange":{"start":1,"end":3},"context":{"type":"demo"}});
   done();
 },
Example #12
0
 it('should ignore annotations that won\'t return anything', function(){
  var result = parser.parse ( comments );
       assert.deepEqual(result[2].ignore , []);
 });
Example #13
0
 it('should extract comments', function (){
   var comments = getCommentsFrom('singleLineBlock.test.scss');
   assert.equal(comments.length, 1);
   assert.deepEqual(comments[0].lines, ['block comment on a single line']);
   assert.deepEqual(comments[0].commentRange, { start: 1, end: 1 });
 });
Example #14
0
 it('should preserve subsequent line comments on the same line', function(){
   var comments = getCommentsFrom('linePreserveNested.test.scss');
   assert.deepEqual(comments[0].lines, ['Preserves /// nested', '/// comments', '//// all /// over', 'the ////// place']);
 });
Example #15
0
 Lazy.range('5..50').join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(5, 50));
     assert.equal(xs.length, 45);
 });
Example #16
0
 it('should extract line commments with leading spaces', function(){
   var comments = getCommentsFrom('lineIndentionBefore.test.scss');
   assert.deepEqual(comments[0].lines, [ 'Just a test', '   ' ]);
   assert.deepEqual(comments[0].type, 'poster');
 });
Example #17
0
 Lazy.range('50..44').join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(50, 44));
     assert.equal(xs.length, 6);
 });
Example #18
0
 it('should calculate KST using the calculate method', function() {
   assert.deepEqual(KST.calculate(input), expectResult, 'Wrong Results');
 });
Example #19
0
 Lazy.range('4,3.9..1').join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(4,1,0.1));
     assert.equal(xs.length, 30);
 });
Example #20
0
 it('should be able to calculate KST by using getResult', function() {
   let roc = new KST(input);
   assert.deepEqual(roc.getResult(),  expectResult, 'Wrong Results while calculating next bar');
 });
Example #21
0
 Lazy.range('(1..10]').join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(2,11));
     assert.equal(xs.length, 9);
 });
Example #22
0
 it('should be able to calculate KST for reversed input by using calculate method', function() {
   let myInput = Object.assign({}, input);
   myInput.reversedInput = true;
   myInput.values.reverse();
   assert.deepEqual(KST.calculate(myInput),  expectResult.slice().reverse(), 'Wrong Results while calculating next bar');
 });
Example #23
0
 Lazy.range('[5,10..50]').join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(5,51,5));
     assert.equal(xs.length, 10);
 });
Example #24
0
 it('should subtract bignumbers', function() {
   assert.deepEqual(subtract(bignumber(0.3), bignumber(0.2)), bignumber(0.1));
   assert.deepEqual(subtract(bignumber('2.3e5001'), bignumber('3e5000')), bignumber('2e5001'));
   assert.deepEqual(subtract(bignumber('1e19'), bignumber('1')), bignumber('9999999999999999999'));
 });
Example #25
0
 Lazy.range(-10, 10, 2).join(function (xs) {
     joinExecuted = true;
     assert.deepEqual(xs, range(-10, 10, 2));
     assert.equal(xs.length, 10);
 });
Example #26
0
 it('should subtract mixed booleans and bignumbers', function() {
   assert.deepEqual(subtract(bignumber(1.1), true), bignumber(0.1));
   assert.deepEqual(subtract(false, bignumber(0.2)), bignumber(-0.2));
 });
Example #27
0
  it('slighty more complex graph', function() {
    /*
            ┌───────────────┐
            │#1 TotalTime: 5│
            └───────────────┘
                    │
        ╔═══════════╩──────────┐
        ║                      │
        ▼                      ▼
┌───────────────┐      ┌───────────────┐
│#2 TotalTime: 4│      │#3 TotalTime: 3│
└───────────────┘      └───────────────┘
        ║                      │
        ║                      │
        ▼                      ▼
┌───────────────┐      ┌───────────────┐
│#4 TotalTime: 2│      │#5 TotalTime: 2│
└───────────────┘      └───────────────┘
        ║                      │
        ║                      │
        ▼                      ▼
┌───────────────┐     ┌────────────────┐
│#6 TotalTime: 2│     │#7 TotalTime: 1 │
└───────────────┘     └────────────────┘
    */

    var g = buildGraph([{
      _id: 1,
      stats: {
        time: {
          self: 0,
        },
      },
      children: [3, 2]
    }, {
      _id: 2,
      stats: {
        time: {
          self: 2,
        },
      },
      children: [4]
    }, {
      _id: 3,
      stats: {
        time: {
          self: 1,
        },
      },
      children: [5]
    }, {
      _id: 4,
      stats: {
        time: {
          self: 0,
        },
      },
      children: [6]
    }, {
      _id: 5,
      stats: {
        time: {
          self: 1,
        },
      },
      children: [7]
    }, {
      _id: 6,
      stats: {
        time: {
          self: 2,
        },
      },
      children: []
    }, {
      _id: 7,
      stats: {
        time: {
          self: 1,
        },
      },
      children: []
    }]);

    var ranked = rank(g).nodes;

    assert.deepEqual(ranked.map(byLevel), [0, 0, 1, 0, 1, 0, 1]);
  });
Example #28
0
process.on('exit', function() {
  assert.deepEqual(events, ['connectCb', 'data', 'close']);
});
Example #29
0
 it('returns values for requested properties', function() {
     assert.deepEqual(R.props(['a', 'e'], obj), [1, 5]);
 });
Example #30
0
 'has recorded song': function(score) {
   assert.deepEqual(score.recording, oneNote);
 },