mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
more tests
This commit is contained in:
parent
30b7eb7c73
commit
e0023a722b
@ -148,7 +148,7 @@ class Pattern {
|
||||
|
||||
|
||||
|
||||
split_queries() {
|
||||
splitQueries() {
|
||||
// Splits queries at cycle boundaries. This makes some calculations
|
||||
// easier to express, as all events are then constrained to happen within
|
||||
// a cycle.
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
|
||||
import 'fraction.js';
|
||||
import Fraction from 'fraction.js'
|
||||
|
||||
import { strict as assert } from 'assert';
|
||||
|
||||
import {TimeSpan, Hap} from "../js/strudel.mjs";
|
||||
import {TimeSpan, Hap, Pattern, pure} from "../js/strudel.mjs";
|
||||
|
||||
describe('TimeSpan', function() {
|
||||
describe('equal()', function() {
|
||||
@ -11,6 +10,11 @@ describe('TimeSpan', function() {
|
||||
assert.equal((new TimeSpan(0,4)).equals(new TimeSpan(0,4)), true);
|
||||
});
|
||||
});
|
||||
describe('splitCycles', function() {
|
||||
it('Should split two cycles into two', function() {
|
||||
assert.equal(new TimeSpan(Fraction(0),Fraction(2)).spanCycles.length, 2)
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
describe('Hap', function() {
|
||||
@ -20,4 +24,11 @@ describe('Hap', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('Pattern', function() {
|
||||
describe('pure', function () {
|
||||
it('Can make a pattern', function() {
|
||||
assert.equal(pure("hello").query(new TimeSpan(Fraction(0.5), Fraction(2.5))).length, 3)
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user