head	1.2;
access;
symbols
	tcllib-1-13:1.2
	tcllib-1-12:1.2;
locks; strict;
comment	@# @;


1.2
date	2009.11.15.05.50.03;	author andreas_kupries;	state Exp;
branches;
next	1.1;

1.1
date	2009.04.18.21.14.21;	author andreas_kupries;	state Exp;
branches;
next	;


desc
@@


1.2
log
@
	* container.test: Fixed up typos in comments refering to keyword
	* export.tcl: indices, while the packages are all about tables of
	* export_doctoc.tcl: contents. Unchanged functionality, version
	* export_doctoc.test: left unchanged.
	* export_html.tcl:
	* export_html.test:
	* export_json.tcl:
	* export_json.test:
	* export_nroff.tcl:
	* export_nroff.test:
	* export_text.tcl:
	* export_text.test:
	* export_wiki.tcl:
	* export_wiki.test:
	* import.tcl:
	* import_doctoc.tcl:
	* import_json.tcl:
	* include/export/config/doctoc.inc:
	* include/export/config/html.inc:
	* include/export/config/nroff.inc:
	* include/export/plugin.inc:
	* include/import/plugin.inc:
	* parse.tcl:
	* tests/container:
	* tests/export:
	* tests/import:
@
text
@# -*- tcl -*-
# toc_export.testsuite: Tests for the management of toc export plugins.
#
# Copyright (c) 2009 Andreas Kupries <andreas_kupries@@users.sourceforge.net>
# All rights reserved.
#
# RCS: @@(#) $Id: export,v 1.1 2009/04/18 21:14:21 andreas_kupries Exp $

# -------------------------------------------------------------------------

# Tests are run for all formats we have an export plugin for.

# -------------------------------------------------------------------------

set mytestdir      tests/data
set mytestconfig   {fox dog lazy jump}
set mytestincludes [TestFilesGlob $mytestdir]

# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# doctoc markup

# Testing the export of doctoc markup through an exporter manager, for
# all possible configurations.

foreach {k nl in al section} {
    0 0 0 0 -ultracompact
    1 1 0 0 -compact
    2 1 1 0 -indented
    3 1 0 1 -aligned
    4 1 1 1 -indalign
    5 0 1 0 -indented
    6 0 0 1 -aligned
    7 0 1 1 -indalign
} {
    TestFilesProcess $mytestdir ok serial doctoc$section -> n label input data expected {
	test doctools-toc-export-plugin-doctoc-20.$k.$n "doctools::toc::export /doctoc, $label$section, ok" -setup {
	    doctools::toc::export OUT
	    OUT config set newlines $nl
	    OUT config set indented $in
	    OUT config set aligned  $al
	} -body {
	    stripcomments [OUT export serial $data doctoc]
	} -cleanup {
	    OUT destroy
	} -result $expected
    }
}

# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# text markup

TestFilesProcess $mytestdir ok serial text -> n label input data expected {
    test doctools-toc-export-plugin-text-21.$n "doctools::toc::export /text, $label, ok" -setup {
	doctools::toc::export OUT
    } -body {
	OUT export serial $data text
    } -cleanup {
	OUT destroy
    } -result $expected
}

# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# json markup

foreach {k in al section} {
    0 0 0 -ultracompact
    1 1 0 -indented
    2 0 1 -indalign
    3 1 1 -indalign
} {
    TestFilesProcess $mytestdir ok serial json$section -> n label input data expected {
	test doctools-toc-export-plugin-json-22.$k.$n "doctools::toc::export /json, $label$section, ok" -setup {
	    doctools::toc::export OUT
	    OUT config set indented $in
	    OUT config set aligned  $al
	} -body {
	    OUT export serial $data json
	} -cleanup {
	    OUT destroy
	} -result $expected
    }
}

# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# html markup

foreach {k nl in section} {
    0 0 0 -ultracompact
    1 0 1 -indented
    2 1 0 -compact
    3 1 1 -indented
} {
    TestFilesProcess $mytestdir ok serial html$section -> n label input data expected {
	test doctools-toc-export-plugin-html-23.$k.$n "doctools::toc::export /html, $label$section, ok" -setup {
	    doctools::toc::export OUT
	    OUT config set newlines $nl
	    OUT config set indented $in
	    OUT config set user _dummy_
	} -body {
	    striphtmlcomments [OUT export serial $data html] 3
	} -cleanup {
	    OUT destroy
	} -result $expected
    }
}

# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# wiki markup

TestFilesProcess $mytestdir ok serial wiki -> n label input data expected {
    test doctools-toc-export-plugin-wiki-23.$n "doctools::toc::export /wiki, $label, ok" -setup {
	doctools::toc::export OUT
    } -body {
	OUT export serial $data wiki
    } -cleanup {
	OUT destroy
    } -result $expected
}

# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# nroff markup

foreach {k inline section} {
    0 0 -external
    1 1 -inlined
} {
    TestFilesProcess $mytestdir ok serial nroff$section -> n label input data expected {
	test doctools-toc-export-plugin-nroff-24.$k.$n "doctools::toc::export /nroff, $label$section, ok" -setup {
	    doctools::toc::export OUT
	    OUT config set inline $inline
	} -body {
	    stripnroffcomments [stripmanmacros [OUT export serial $data nroff]]
	} -cleanup {
	    OUT destroy
	} -result $expected
    }
}

# -------------------------------------------------------------------------
unset mytestdir n label input data expected
return
@


1.1
log
@
	* Doctools version 2, processing tables of contents.
@
text
@d2 1
a2 1
# toc_export.testsuite: Tests for the managed of index export plugins.
d7 1
a7 1
# RCS: @@(#) $Id: export,v 1.1 2009/04/01 04:28:37 andreas_kupries Exp $
@

