aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/test_utils/src')
-rw-r--r--crates/test_utils/src/bench_fixture.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/test_utils/src/bench_fixture.rs b/crates/test_utils/src/bench_fixture.rs
index 41fcca635..aa1bea9bb 100644
--- a/crates/test_utils/src/bench_fixture.rs
+++ b/crates/test_utils/src/bench_fixture.rs
@@ -1,7 +1,11 @@
1//! Generates large snippets of Rust code for usage in the benchmarks. 1//! Generates large snippets of Rust code for usage in the benchmarks.
2 2
3use std::fs;
4
3use stdx::format_to; 5use stdx::format_to;
4 6
7use crate::project_dir;
8
5pub fn big_struct() -> String { 9pub fn big_struct() -> String {
6 let n = 1_000; 10 let n = 1_000;
7 11
@@ -26,3 +30,8 @@ struct S{} {{
26 30
27 buf 31 buf
28} 32}
33
34pub fn glorious_old_parser() -> String {
35 let path = project_dir().join("bench_data/glorious_old_parser");
36 fs::read_to_string(&path).unwrap()
37}