forked from supercollider-quarks/CommonTests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestPattern.sc
58 lines (44 loc) · 1.16 KB
/
TestPattern.sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
TestPattern : UnitTest {
/*
test_storeArgs {
Pattern.allSubclasses.do({ |class|
this.assert( class.findMethod('storeArgs').notNil
})
}
*/
/*
var exceptions;
exceptions = [PatternProxy,PbindProxy,Pbind,PFork,Pprob,Pflow,PlazyEnvirN,ListPattern,Pmono,Pfx,Pbindf,Pslide,Pwrand,Pseq,Pwalk,Pdfsm];
Pattern.allSubclasses.reject(IsIn(exceptions)).do({ |class|
var constructor,argNames,decoys,new;
var storeArgs,asCompileString, recompile;
// list a few exception classes here
"".postln;
// num of args in constructor,
constructor = class.class.findMethod('new');
if(constructor.isNil,{
"no constructor".debug(class)
},{
argNames = constructor.argNames;
decoys = argNames.copyRange(1,argNames.size-1).as(Array);
decoys.debug(class);
if(constructor.argNames.notNil,{
//yep, we just fed it its own argNames
new = class.performList('new',decoys);
});
// do storeArgs
storeArgs = new.storeArgs;
if((storeArgs == decoys),{
"TRUE!".debug;
},{
storeArgs.debug("failed storeArgs");
})
// numbers should come back the same
// do asCompileString
// recompile
//
// should be the same
})
})
*/
}