File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,19 @@ rust_test {
11
11
host_supported : true ,
12
12
test_suites : [" general-tests" ],
13
13
}
14
+
15
+ rust_test {
16
+ name : " libgoogletest_example" ,
17
+ crate_name : " googletest_example" ,
18
+ srcs : [" googletest.rs" ],
19
+ rustlibs : [" libgoogletest_rust" ],
20
+ host_supported : true ,
21
+ }
22
+
23
+ rust_test {
24
+ name : " libmockall_example" ,
25
+ crate_name : " mockall_example" ,
26
+ srcs : [" mockall.rs" ],
27
+ rustlibs : [" libmockall" ],
28
+ host_supported : true ,
29
+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ pub trait Pet {
10
10
fn test_robot_dog ( ) {
11
11
let mut mock_dog = MockPet :: new ( ) ;
12
12
mock_dog. expect_is_hungry ( ) . return_const ( true ) ;
13
- assert_eq ! ( mock_dog. is_hungry( Duration :: from_secs( 10 ) ) , true ) ;
13
+ assert ! ( mock_dog. is_hungry( Duration :: from_secs( 10 ) ) ) ;
14
14
}
15
15
// ANCHOR_END: simple_example
16
16
@@ -23,7 +23,7 @@ fn test_robot_cat() {
23
23
. with ( mockall:: predicate:: gt ( Duration :: from_secs ( 3 * 3600 ) ) )
24
24
. return_const ( true ) ;
25
25
mock_cat. expect_is_hungry ( ) . return_const ( false ) ;
26
- assert_eq ! ( mock_cat. is_hungry( Duration :: from_secs( 1 * 3600 ) ) , false ) ;
27
- assert_eq ! ( mock_cat. is_hungry( Duration :: from_secs( 5 * 3600 ) ) , true ) ;
26
+ assert ! ( mock_cat. is_hungry( Duration :: from_secs( 5 * 3600 ) ) ) ;
27
+ assert ! ( ! mock_cat. is_hungry( Duration :: from_secs( 5 ) ) ) ;
28
28
}
29
29
// ANCHOR_END: extended_example
You can’t perform that action at this time.
0 commit comments