Skip to content

Commit

Permalink
test: disable some tests on non-64-bit
Browse files Browse the repository at this point in the history
Some doc tests make 64-bit assumptions and fail on 32-bit. I'd be open
to perhaps refactoring the tests somehow to make them work on both, but
I literally have no easy way to run doc tests in a 32-bit environment.
Without being able to actually run them myself, I don't feel comfortable
doing anything other than squashing the tests in that case.

Closes #1041
  • Loading branch information
BurntSushi committed Oct 8, 2023
1 parent 2e8d52c commit 296b1b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions regex-lite/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,7 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> {
/// This example shows how to create and use `CaptureLocations` in a search.
///
/// ```
/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041
/// use regex_lite::Regex;
///
/// let re = Regex::new(r"(?<first>\w+)\s+(?<last>\w+)").unwrap();
Expand Down
4 changes: 4 additions & 0 deletions src/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ pub(crate) mod string {
/// # Example
///
/// ```
/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041
/// use regex::RegexBuilder;
///
/// // It may surprise you how big some seemingly small patterns can
Expand Down Expand Up @@ -1246,6 +1247,7 @@ pub(crate) mod string {
/// # Example
///
/// ```
/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041
/// use regex::RegexSetBuilder;
///
/// // It may surprise you how big some seemingly small patterns can
Expand Down Expand Up @@ -1856,6 +1858,7 @@ pub(crate) mod bytes {
/// # Example
///
/// ```
/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041
/// use regex::bytes::RegexBuilder;
///
/// // It may surprise you how big some seemingly small patterns can
Expand Down Expand Up @@ -2428,6 +2431,7 @@ pub(crate) mod bytes {
/// # Example
///
/// ```
/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041
/// use regex::bytes::RegexSetBuilder;
///
/// // It may surprise you how big some seemingly small patterns can
Expand Down
1 change: 1 addition & 0 deletions src/regex/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,7 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> {
/// This example shows how to create and use `CaptureLocations` in a search.
///
/// ```
/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041
/// use regex::bytes::Regex;
///
/// let re = Regex::new(r"(?<first>\w+)\s+(?<last>\w+)").unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/regex/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,7 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> {
/// This example shows how to create and use `CaptureLocations` in a search.
///
/// ```
/// # if !cfg!(target_pointer_width = "64") { return Ok(()); } // see #1041
/// use regex::Regex;
///
/// let re = Regex::new(r"(?<first>\w+)\s+(?<last>\w+)").unwrap();
Expand Down

0 comments on commit 296b1b6

Please sign in to comment.