Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
d5cb9781
Unverified
Commit
d5cb9781
authored
Nov 22, 2017
by
Chris Bracken
Committed by
GitHub
Nov 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate unused matcher_util in flutter_driver (#13159)
Use of this file was eliminated in
e7657b94
.
parent
34ba6be9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
136 deletions
+1
-136
matcher_util.dart
packages/flutter_driver/lib/src/matcher_util.dart
+0
-82
pubspec.yaml
packages/flutter_driver/pubspec.yaml
+1
-1
matcher_util_test.dart
packages/flutter_driver/test/src/matcher_util_test.dart
+0
-53
No files found.
packages/flutter_driver/lib/src/matcher_util.dart
deleted
100644 → 0
View file @
34ba6be9
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:matcher/matcher.dart'
;
/// Matches [value] against the [matcher].
MatchResult
match
(
dynamic
value
,
Matcher
matcher
)
{
final
Map
<
dynamic
,
dynamic
>
matchState
=
<
dynamic
,
dynamic
>{};
if
(
matcher
.
matches
(
value
,
matchState
))
{
return
new
MatchResult
.
_matched
();
}
else
{
final
Description
description
=
matcher
.
describeMismatch
(
value
,
new
_TextDescription
(),
matchState
,
false
,
);
return
new
MatchResult
.
_mismatched
(
description
.
toString
());
}
}
/// Result of matching a value against a matcher.
class
MatchResult
{
MatchResult
.
_matched
()
:
hasMatched
=
true
,
mismatchDescription
=
null
;
MatchResult
.
_mismatched
(
this
.
mismatchDescription
)
:
hasMatched
=
false
;
/// Whether the match succeeded.
final
bool
hasMatched
;
/// If the match did not succeed, this field contains the explanation.
final
String
mismatchDescription
;
}
/// Writes description into a string.
class
_TextDescription
implements
Description
{
final
StringBuffer
_text
=
new
StringBuffer
();
@override
int
get
length
=>
_text
.
length
;
@override
Description
add
(
String
text
)
{
_text
.
write
(
text
);
return
this
;
}
@override
Description
replace
(
String
text
)
{
_text
.
clear
();
_text
.
write
(
text
);
return
this
;
}
@override
Description
addDescriptionOf
(
dynamic
value
)
{
if
(
value
is
Matcher
)
{
value
.
describe
(
this
);
return
this
;
}
else
{
return
add
(
'
$value
'
);
}
}
@override
Description
addAll
(
String
start
,
String
separator
,
String
end
,
Iterable
<
dynamic
>
list
)
{
add
(
start
);
if
(
list
.
isNotEmpty
)
{
addDescriptionOf
(
list
.
first
);
for
(
dynamic
item
in
list
.
skip
(
1
))
{
add
(
separator
);
addDescriptionOf
(
item
);
}
}
add
(
end
);
return
this
;
}
@override
String
toString
()
=>
'
$_text
'
;
}
packages/flutter_driver/pubspec.yaml
View file @
d5cb9781
...
...
@@ -10,7 +10,6 @@ environment:
dependencies
:
file
:
2.3.4
json_rpc_2
:
2.0.4
matcher
:
0.12.1+4
meta
:
1.1.1
path
:
1.4.2
web_socket_channel
:
1.0.6
...
...
@@ -40,6 +39,7 @@ dev_dependencies:
intl
:
0.15.2
# TRANSITIVE DEPENDENCY
io
:
0.3.0
# TRANSITIVE DEPENDENCY
js
:
0.6.1
# TRANSITIVE DEPENDENCY
matcher
:
0.12.1+4
# TRANSITIVE DEPENDENCY
mime
:
0.9.4
# TRANSITIVE DEPENDENCY
node_preamble
:
1.4.0
# TRANSITIVE DEPENDENCY
package_config
:
1.0.3
# TRANSITIVE DEPENDENCY
...
...
packages/flutter_driver/test/src/matcher_util_test.dart
deleted
100644 → 0
View file @
34ba6be9
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:test/test.dart'
;
import
'package:flutter_driver/src/matcher_util.dart'
;
void
main
(
)
{
group
(
'match'
,
()
{
test
(
'matches'
,
()
{
final
_TestMatcher
matcher
=
new
_TestMatcher
(
1
);
final
MatchResult
ok
=
match
(
1
,
matcher
);
expect
(
ok
.
hasMatched
,
isTrue
);
expect
(
ok
.
mismatchDescription
,
isNull
);
expect
(
matcher
.
matchState1
is
Map
<
dynamic
,
dynamic
>,
isTrue
);
expect
(
matcher
.
matchState2
,
isNull
);
});
test
(
'mismatches'
,
()
{
final
_TestMatcher
matcher
=
new
_TestMatcher
(
2
);
final
MatchResult
fail
=
match
(
1
,
matcher
);
expect
(
fail
.
hasMatched
,
isFalse
);
expect
(
fail
.
mismatchDescription
,
'mismatch!'
);
expect
(
matcher
.
matchState1
,
matcher
.
matchState2
);
});
});
}
class
_TestMatcher
extends
Matcher
{
int
expected
;
Map
<
dynamic
,
dynamic
>
matchState1
;
Map
<
dynamic
,
dynamic
>
matchState2
;
_TestMatcher
(
this
.
expected
);
@override
bool
matches
(
dynamic
item
,
Map
<
dynamic
,
dynamic
>
matchState
)
{
matchState1
=
matchState
;
return
item
==
expected
;
}
@override
Description
describeMismatch
(
dynamic
item
,
Description
mismatchDescription
,
Map
<
dynamic
,
dynamic
>
matchState
,
bool
verbose
)
{
matchState2
=
matchState
;
mismatchDescription
.
add
(
'mismatch!'
);
return
mismatchDescription
;
}
@override
Description
describe
(
Description
description
)
{
throw
'not implemented'
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment