fix tests

This commit is contained in:
Sky Johnson 2024-09-20 16:13:00 -05:00
parent 2bf838b8ba
commit de40b4779c

View File

@ -1,7 +1,7 @@
<?php
require_once 'color.php';
require_once __DIR__ . '/../src/Router.php';
require_once __DIR__ . '/../src/RouterInterface.php';
require_once __DIR__ . '/../src/SegmentRouter.php';
const ROUTES = __DIR__ . '/routes/';
@ -22,7 +22,7 @@ $r = new SegmentRouter();
// Blog lookups
$blog = readAndAddRoutes(ROUTES . 'blog.txt', $r);
writeRoutesToFile($r->routes, TREES . 'blog.txt');
writeRoutesToFile($r->dump(), TREES . 'blog.txt');
echoTitle("Starting blog lookups");
runIterations(10000, $r, $blog);
runIterations(100000, $r, $blog);
@ -32,7 +32,7 @@ unset($blog);
// Github lookups
$r->clear();
$github = readAndAddRoutes(ROUTES . 'github.txt', $r);
writeRoutesToFile($r->routes, TREES . 'github.txt');
writeRoutesToFile($r->dump(), TREES . 'github.txt');
echoTitle("Starting github lookups");
runIterations(10000, $r, $github);
runIterations(100000, $r, $github);
@ -42,7 +42,7 @@ unset($github);
// Big lookups
$r->clear();
$big = readAndAddRoutes(ROUTES . 'big.txt', $r);
writeRoutesToFile($r->routes, TREES . 'big.txt');
writeRoutesToFile($r->dump(), TREES . 'big.txt');
echoTitle("Starting big lookups");
runIterations(10000, $r, $big);
runIterations(100000, $r, $big);