Skip to content

Commit 21f04f3

Browse files
authored
Merge pull request #31 from Veetaha/master
Add data getter to `Expect`
2 parents ec83506 + 001059b commit 21f04f3

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
# 1.3.0
2+
3+
* Add `data()` getter to Expect ([#31])
4+
* Support single delimiter version of `expect![]` ([#27])
5+
* Allow users to rebind `expect!` ([#26])
6+
17
# 1.2.2
28

9+
* Parse string literals to find their length ([#23])
310
* Do not use `fs::canonicalize`.
411

512
# 1.2.1
613

714
* No changelog until this point :-(
15+
16+
[#31]: https://github.com/rust-analyzer/expect-test/pull/31
17+
[#27]: https://github.com/rust-analyzer/expect-test/pull/27
18+
[#26]: https://github.com/rust-analyzer/expect-test/pull/26
19+
[#23]: https://github.com/rust-analyzer/expect-test/pull/23

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "expect-test"
3-
version = "1.2.2"
3+
version = "1.3.0"
44
description = "Minimalistic snapshot testing library"
55
keywords = ["snapshot", "testing", "expect"]
66
categories = ["development-tools::testing"]

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ impl Expect {
294294
self.indent = yes;
295295
}
296296

297+
/// Returns the content of this expect.
298+
pub fn data(&self) -> &str {
299+
self.data
300+
}
301+
297302
fn trimmed(&self) -> String {
298303
if !self.data.contains('\n') {
299304
return self.data.to_string();

0 commit comments

Comments
 (0)