11import { Chapter } from '../../types'
22import { stripIndent } from '../../utils/formatters'
3- import { testSuccess } from '../../utils/testing'
3+ import { expectFinishedResult } from '../../utils/testing'
44import * as list from '../list'
55
66test ( 'display_list is linear runtime' , ( ) => {
@@ -12,9 +12,8 @@ test('display_list is linear runtime', () => {
1212 return list . rawDisplayList ( ( x : any ) => x , v , s === placeholder ? undefined : s )
1313 }
1414
15- return expect (
16- testSuccess (
17- stripIndent `
15+ return expectFinishedResult (
16+ stripIndent `
1817 const build_inf = (i, f) => {
1918 const t = list(f(i));
2019 let p = t;
@@ -27,7 +26,7 @@ test('display_list is linear runtime', () => {
2726 const make_complex_list = n => {
2827 // makes a complex list structure with O(n) pairs
2928 const cuberootn = math_floor(math_pow(n, 0.33));
30- return build_list(cuberootn, _ => build_inf(cuberootn, _ => build_list(cuberootn, i =>i)) );
29+ return build_list(_ => build_inf(cuberootn, _ => build_list(i => i, cuberootn)), cuberootn );
3130 };
3231 const time_display_list = xs => {
3332 const starttime = get_time();
@@ -103,14 +102,13 @@ test('display_list is linear runtime', () => {
103102 const slope = head(line);
104103 slope;
105104 ` ,
106- {
107- chapter : Chapter . SOURCE_3 ,
108- testBuiltins : {
109- no_display_list : noDisplayList
110- }
105+ {
106+ chapter : Chapter . SOURCE_3 ,
107+ testBuiltins : {
108+ no_display_list : noDisplayList
111109 }
112- ) . then ( testResult => testResult . result )
113- ) . resolves . toBeLessThan ( 1.2 )
110+ }
111+ ) . toBeLessThan ( 1.2 )
114112 // estimated power is less than 1.2
115113 // means it's probably near 1
116114 // => probably linear?
0 commit comments