3 * Test unitaire des raccourcis Markdown dans SPIP
7 $test = 'tw_propre_typo';
9 while (!is_dir($remonte . "ecrire")) {
10 $remonte = "../$remonte";
12 require $remonte . 'tests/test.inc';
13 find_in_path("inc/texte.php", '', true);
15 $GLOBALS['spip_lang'] = 'fr'; // corrections typo
16 $GLOBALS['class_spip_plus'] = '';
17 $GLOBALS['class_spip'] = '';
19 // ajouter le dossier squelettes de test au chemin
20 _chemin(_DIR_PLUGIN_TW
. "tests/squelettes/");
22 $notes = charger_fonction("notes", "inc");
23 function propre_notes($texte) {
25 $texte = propre($texte);
26 if ($r = $notes(array())) {
27 $texte .= "<div class='notes'>$r</div>";
28 $notes('', 'depiler');
29 $notes('', 'empiler');
38 $err = tester_fun('propre_notes', essais_tw_propre_typo());
40 // si le tableau $err est pas vide ca va pas
42 die ('<dl>' . join('', $err) . '</dl>');
48 function essais_tw_propre_typo() {
50 $tests = preg_files(_DIR_PLUGIN_TW
. "tests/data/typo/", '\.txt$');
52 $texte = $expected = "";
55 foreach ($tests as $t) {
56 lire_fichier($t, $texte);
57 lire_fichier(substr($t, 0, -4) . ".html", $expected);
58 $essais[basename($t, ".txt")] = array(