Skip to content

Data Table Matcher #51

@VDFaller

Description

@VDFaller

I'd suggest a data table matcher. Currently for our implementation we're using this

/* 
	Class: UtEqualToDataTableMatcher
		---Prototype---
		class UtEqualToDataTableMatcher inherits UtEqualToMatcher
		---------------
		
		Operates only on datatables. See <UtEqualToMatcher>.
*/
Define Class(
	"UtEqualToDataTableMatcher",
	Base Class( UtEqualToMatcher ),
	_init_ = Method({}, super:matches value = Name Expr( this:matches value ) );
	matches value = Method({actual},
		obj = actual << Compare Data Tables( compare With( this:value ) );
		
		If( !(obj << Are Data Different),
			::ut match info success();
		,
			mismatch = "was " || Char( actual );
			LRE = ::ut global lre( actual, this:value );
			::ut match info failure( mismatch, LRE );
		);
	);
);

but this doesn't take into account table variables, or scripts. It just checks that the data are the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmatcherNew Matcher or substantial work on existing Matcher

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions