Add Teswts *UWU*

pull/2/head
Isaac Mills 3 years ago
parent 29292bd1c9
commit e3459a3ed8
No known key found for this signature in database
GPG Key ID: B67D7410F33A0F61

@ -33,3 +33,6 @@ rand_xoshiro = "0.6.0"
lto = "fat"
codegen-units = 1
panic = "abort"
[features]
bench = []

File diff suppressed because it is too large Load Diff

@ -1,3 +1,5 @@
#![cfg_attr(test, feature(test))]
use linkify::{LinkFinder, LinkKind};
use std::error::Error;
use std::fs::File;
@ -92,9 +94,14 @@ impl UwUify {
uwu_progress_bar.finish("UwU'ifying Complete!");
Ok(())
} else {
#[cfg(not(test))]
let stdout = std::io::stdout();
#[cfg(not(test))]
let mut out = UwUOutFile::new(stdout.lock());
#[cfg(test)]
let mut out = UwUOutFile::new(std::io::sink());
self.uwuify_sentence(&self.text, &mut out)?;
#[cfg(not(test))]
out.write_newline()?;
Ok(())
}
@ -231,3 +238,24 @@ impl UwUify {
word
}
}
#[cfg(test)]
mod tests {
extern crate test;
#[bench]
fn uwu_bench(b: &mut test::Bencher) {
let uwuify = super::UwUify::new(
Some(include_str!("test.txt").to_string()),
None,
None,
false,
1.0,
0.05,
0.125,
0.225,
false,
);
b.iter(|| uwuify.uwuify());
}
}

@ -0,0 +1,14 @@
From fairest creatures we desire increase,
That thereby beauty's rose might never die,
But as the riper should by time decease,
His tender heir might bear his memory:
But thou contracted to thine own bright eyes,
Feed'st thy light's flame with self-substantial fuel,
Making a famine where abundance lies,
Thy self thy foe, to thy sweet self too cruel:
Thou that art now the world's fresh ornament,
And only herald to the gaudy spring,
Within thine own bud buriest thy content,
And tender churl mak'st waste in niggarding:
Pity the world, or else this glutton be,
To eat the world's due, by the grave and thee.
Loading…
Cancel
Save