Skip to content

Commit a4e3377

Browse files
bjacotgcopybara-github
authored andcommitted
Move util files to the matcher_support module.
PiperOrigin-RevId: 529710028
1 parent a988708 commit a4e3377

14 files changed

+32
-17
lines changed

googletest/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ extern crate googletest_macro;
383383
pub mod assertions;
384384
pub mod internal;
385385
pub mod matcher;
386+
pub mod matcher_support;
386387
pub mod matchers;
387388

388389
pub mod prelude {

googletest/src/matchers/description.rs renamed to googletest/src/matcher_support/description.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl Description {
7474
///
7575
/// ```
7676
/// # use googletest::prelude::*;
77-
/// # use googletest::matchers::description::Description;
77+
/// # use googletest::matcher_support::description::Description;
7878
/// let description = std::iter::once("A B C\nD E F".to_string()).collect::<Description>();
7979
/// verify_that!(description.indent(), displays_as(eq(" A B C\n D E F")))
8080
/// # .unwrap();
@@ -94,7 +94,7 @@ impl Description {
9494
///
9595
/// ```
9696
/// # use googletest::prelude::*;
97-
/// # use googletest::matchers::description::Description;
97+
/// # use googletest::matcher_support::description::Description;
9898
/// let description = std::iter::once("A B C\nD E F".to_string()).collect::<Description>();
9999
/// verify_that!(description.bullet_list(), displays_as(eq("* A B C\n D E F")))
100100
/// # .unwrap();
@@ -114,7 +114,7 @@ impl Description {
114114
///
115115
/// ```
116116
/// # use googletest::prelude::*;
117-
/// # use googletest::matchers::description::Description;
117+
/// # use googletest::matcher_support::description::Description;
118118
/// let description = std::iter::once("A B C\nD E F".to_string()).collect::<Description>();
119119
/// verify_that!(description.enumerate(), displays_as(eq("0. A B C\n D E F")))
120120
/// # .unwrap();

googletest/src/matcher_support/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
pub(crate) mod count_elements;
16+
pub mod description;
17+
pub(crate) mod edit_distance;
18+
pub(crate) mod zipped_iterator;

googletest/src/matchers/all_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ macro_rules! all {
6565
#[doc(hidden)]
6666
pub mod internal {
6767
use crate::matcher::{MatchExplanation, Matcher, MatcherResult};
68+
use crate::matcher_support::description::Description;
6869
use crate::matchers::anything;
69-
use crate::matchers::description::Description;
7070
use std::fmt::Debug;
7171

7272
/// A matcher which matches an input value matched by all matchers in the

googletest/src/matchers/each_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
use crate::matcher::{MatchExplanation, Matcher, MatcherResult};
16-
use crate::matchers::description::Description;
16+
use crate::matcher_support::description::Description;
1717
use std::{fmt::Debug, marker::PhantomData};
1818

1919
/// Matches a container all of whose elements are matched by the matcher

googletest/src/matchers/elements_are_matcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ macro_rules! elements_are {
6868
#[doc(hidden)]
6969
pub mod internal {
7070
use crate::matcher::{MatchExplanation, Matcher, MatcherResult};
71-
use crate::matchers::description::Description;
72-
use crate::matchers::zipped_iterator::zip;
71+
use crate::matcher_support::description::Description;
72+
use crate::matcher_support::zipped_iterator::zip;
7373
use std::{fmt::Debug, marker::PhantomData};
7474

7575
/// This struct is meant to be used only by the macro `elements_are!`.

googletest/src/matchers/eq_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
use crate::matcher::{MatchExplanation, Matcher, MatcherResult};
16-
use crate::matchers::edit_distance;
16+
use crate::matcher_support::edit_distance;
1717
use std::{fmt::Debug, marker::PhantomData};
1818

1919
/// Matches a value equal (in the sense of `==`) to `expected`.

0 commit comments

Comments
 (0)