mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Add failing test
This commit is contained in:
27
inputs/failing/copyCounting/methodCall.ts
Normal file
27
inputs/failing/copyCounting/methodCall.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
//! test_output(1)
|
||||
// Should be: 0
|
||||
|
||||
/// <reference path="../../../concept-code/vs.d.ts" />
|
||||
|
||||
export default function () {
|
||||
return measure(true) - measure(false);
|
||||
}
|
||||
|
||||
function measure(call: boolean) {
|
||||
let c = new Counter();
|
||||
|
||||
if (call) {
|
||||
c.inc();
|
||||
}
|
||||
|
||||
return c.cc.count;
|
||||
}
|
||||
|
||||
class Counter {
|
||||
cc = Debug.makeCopyCounter("cc");
|
||||
value = 0;
|
||||
|
||||
inc() {
|
||||
this.value++;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
//! test_output(0)
|
||||
|
||||
/// <reference path="../../../concept-code/vs.d.ts" />
|
||||
|
||||
export default function main() {
|
||||
return measure(true) - measure(false);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//! test_output(0)
|
||||
|
||||
/// <reference path="../../../concept-code/vs.d.ts" />
|
||||
|
||||
export default function main() {
|
||||
return measure(true) - measure(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user