source: spip-zone/_plugins_/hash_documents/hash_tests.php @ 32396

Last change on this file since 32396 was 32396, checked in by fil@…, 11 years ago

plugin hash_documents, cf. http://www.spip-contrib.net/Le-plugin-hash_documents

File size: 636 bytes
Line 
1<?php
2
3/*
4
5## tests pour hasher les documents
6@require 'ecrire/inc_version.php';
7include_spip('hash_fonctions');
8
9# hasher_adresser_document
10foreach (array(
11        'IMG/mp3/toto.mp3' => 'mp3/1/c/9/toto.mp3',
12        'mp3/toto.mp3' => 'mp3/1/c/9/toto.mp3',
13        'IMG/mp3/a/b/c/toto.mp3' => false,
14        'x' => false,
15) as $s => $r) {
16        if (($a = hasher_adresser_document($s)) !== $r)
17                echo 'hasher_adresser_document: '.var_export($s, true).' => '.var_export($a, true).' != '.var_export($r, true)."\n";
18}
19
20#var_dump(hasher_deplacer_document(1));
21
22spip_timer('hash');
23var_dump(count(hasher_deplacer_n_documents(10000, true)));
24var_dump(spip_timer('hash'));
25
26?>
Note: See TracBrowser for help on using the repository browser.