This commit is contained in:
Ferdinand Majerech 2014-07-31 03:15:56 +02:00
parent 337938f090
commit eb29c2626d

View file

@ -1,5 +1,5 @@
// Copyright Ferdinand Majerech 2011.
// Copyright Ferdinand Majerech 2011-2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@ -18,14 +18,12 @@ import dyaml.testcommon;
import dyaml.token;
/**
* Determine if events in events1 are equivalent to events in events2.
*
* Params: events1 = First event array to compare.
* events2 = Second event array to compare.
*
* Returns: true if the events are equivalent, false otherwise.
*/
/// Determine if events in events1 are equivalent to events in events2.
///
/// Params: events1 = First event array to compare.
/// events2 = Second event array to compare.
///
/// Returns: true if the events are equivalent, false otherwise.
bool compareEvents(Event[] events1, Event[] events2)
{
if(events1.length != events2.length){return false;}
@ -69,16 +67,14 @@ bool compareEvents(Event[] events1, Event[] events2)
return true;
}
/**
* Test emitter by getting events from parsing a file, emitting them, parsing
* the emitted result and comparing events from parsing the emitted result with
* originally parsed events.
*
* Params: verbose = Print verbose output?
* dataFilename = YAML file to parse.
* canonicalFilename = Canonical YAML file used as dummy to determine
* which data files to load.
*/
/// Test emitter by getting events from parsing a file, emitting them, parsing
/// the emitted result and comparing events from parsing the emitted result with
/// originally parsed events.
///
/// Params: verbose = Print verbose output?
/// dataFilename = YAML file to parse.
/// canonicalFilename = Canonical YAML file used as dummy to determine
/// which data files to load.
void testEmitterOnData(bool verbose, string dataFilename, string canonicalFilename)
{
//Must exist due to Anchor, Tags reference counts.
@ -102,14 +98,12 @@ void testEmitterOnData(bool verbose, string dataFilename, string canonicalFilena
assert(compareEvents(events, newEvents));
}
/**
* Test emitter by getting events from parsing a canonical YAML file, emitting
* them both in canonical and normal format, parsing the emitted results and
* comparing events from parsing the emitted result with originally parsed events.
*
* Params: verbose = Print verbose output?
* canonicalFilename = Canonical YAML file to parse.
*/
/// Test emitter by getting events from parsing a canonical YAML file, emitting
/// them both in canonical and normal format, parsing the emitted results and
/// comparing events from parsing the emitted result with originally parsed events.
///
/// Params: verbose = Print verbose output?
/// canonicalFilename = Canonical YAML file to parse.
void testEmitterOnCanonical(bool verbose, string canonicalFilename)
{
//Must exist due to Anchor, Tags reference counts.
@ -135,16 +129,14 @@ void testEmitterOnCanonical(bool verbose, string canonicalFilename)
}
}
/**
* Test emitter by getting events from parsing a file, emitting them with all
* possible scalar and collection styles, parsing the emitted results and
* comparing events from parsing the emitted result with originally parsed events.
*
* Params: verbose = Print verbose output?
* dataFilename = YAML file to parse.
* canonicalFilename = Canonical YAML file used as dummy to determine
* which data files to load.
*/
/// Test emitter by getting events from parsing a file, emitting them with all
/// possible scalar and collection styles, parsing the emitted results and
/// comparing events from parsing the emitted result with originally parsed events.
///
/// Params: verbose = Print verbose output?
/// dataFilename = YAML file to parse.
/// canonicalFilename = Canonical YAML file used as dummy to determine
/// which data files to load.
void testEmitterStyles(bool verbose, string dataFilename, string canonicalFilename)
{
foreach(filename; [dataFilename, canonicalFilename])