Dart DocumentationpropcheckSmallCheck

SmallCheck class

class SmallCheck extends Check {
 final int depth;

 SmallCheck({depth: 4, quiet: false})
     : this.depth = depth
     , super(quiet);

 void check(Property property) {
   final parts = property.enumeration.parts.take(depth + 1);
   int total = 0;
   for (final part in parts) {
     total += part.length;
   }

   int counter = 0;
   int currentDepth = 0;
   for (final part in parts) {
     int card = part.length;
     for(int i = 0; i < card; i++) {
       display("${counter+1}/$total (depth $currentDepth: ${i+1}/$card)");
       _Product arg = part[i];
       if (!property.property(arg)) {
         clear();
         throw Check._errorMessage(counter + 1, arg);
       }
       counter++;
     }
     currentDepth++;
   }
   clear();
 }
}

Extends

Check > SmallCheck

Constructors

new SmallCheck({depth: 4, quiet: false}) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
SmallCheck({depth: 4, quiet: false})
   : this.depth = depth
   , super(quiet);

Properties

final int depth #

final int depth

final bool quiet #

inherited from Check
final bool quiet

Methods

void check(Property property) #

void check(Property property) {
 final parts = property.enumeration.parts.take(depth + 1);
 int total = 0;
 for (final part in parts) {
   total += part.length;
 }

 int counter = 0;
 int currentDepth = 0;
 for (final part in parts) {
   int card = part.length;
   for(int i = 0; i < card; i++) {
     display("${counter+1}/$total (depth $currentDepth: ${i+1}/$card)");
     _Product arg = part[i];
     if (!property.property(arg)) {
       clear();
       throw Check._errorMessage(counter + 1, arg);
     }
     counter++;
   }
   currentDepth++;
 }
 clear();
}

void clear() #

inherited from Check
void clear() => display('');

void display(String message) #

inherited from Check
void display(String message) {
 if (!quiet) {
   stdout.write("\r\u001b[K$message");
 }
}