Skip to content

Commit

Permalink
Definitions test + definitions fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dikmax committed Mar 9, 2015
1 parent e8cf079 commit f9bfa86
Show file tree
Hide file tree
Showing 2 changed files with 566 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/src/definitions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class Target {
Target(this.link, this.title);

String toString() => 'Target "${link}" ${title == null ? "null" : "\"${title}\""}';

bool operator== (obj) => obj is Target &&
link == obj.link && title == obj.title;
}


Expand Down Expand Up @@ -196,6 +199,7 @@ class Blockquote extends Block {
_iterableEquality.equals(contents, obj.contents);
}


class ListItem {
Iterable<Block> contents;

Expand Down Expand Up @@ -304,7 +308,7 @@ class UnorderedList extends ListBlock {
bool operator== (obj) => obj is UnorderedList &&
bulletType == obj.bulletType &&
tight == obj.tight &&
_iterableEquality(items, obj.items);
_iterableEquality.equals(items, obj.items);
}


Expand All @@ -320,7 +324,7 @@ class OrderedList extends ListBlock {
indexSeparator == obj.indexSeparator &&
tight == obj.tight &&
startIndex == obj.startIndex &&
_iterableEquality(items, obj.items);
_iterableEquality.equals(items, obj.items);
}


Expand Down Expand Up @@ -492,8 +496,11 @@ class SmartQuote extends Inline {
? "${open ? "'" : ""}$contents${close ? "'" : ""}"
: "${open ? '"' : ""}$contents${close ? '"' : ""}");

bool operator== (obj) => obj is Emph &&
_iterableEquality.equals(contents, obj.contents);
bool operator== (obj) => obj is SmartQuote &&
single == obj.single &&
open == obj.open &&
close == obj.close &&
_iterableEquality.equals(contents, obj.contents);
}


Expand All @@ -506,7 +513,8 @@ class Code extends Inline {
String toString() => 'Code "$contents"';

bool operator== (obj) => obj is Code &&
contents == obj.contents;
contents == obj.contents &&
fenceSize == obj.fenceSize;
}


Expand Down

0 comments on commit f9bfa86

Please sign in to comment.