-
Notifications
You must be signed in to change notification settings - Fork 7
/
test.ts
69 lines (57 loc) · 2.24 KB
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import Seed from "./seed.ts";
import Uwuifier from "./index.ts";
import { assertEquals } from "jsr:@std/assert";
const uwuifier = new Uwuifier({
spaces: { faces: 0.3, actions: 0.05, stutters: 0.1 },
words: 1,
exclamations: 0,
});
const originalSentences = [
"I had to get a tetanus vaccine when i stabbed my foot by accident",
"When you say tonight, at what time approximately do you mean",
"I need someone to go through the coop thing with me",
"I'm really struggling to put this story toghether, you we're chilling with a dude who has decided that woman sucks",
"No there has been this lockdown in the Netherlands so check out this site: https://www.who.int/health-topics",
"Wow you're old as fuck, you're basically my grandpa you know!",
];
const uwuifiedSentences = [
"I-I-I had to ÚwÚ g-get a tetanyus vaccinye when ^-^ i stabbed my foot by (・`ω´・) accident ÚwÚ",
"When you say UwU tonyight, at what time appwoximatewy do you mean",
"I-I-I nyeed someonye ÚwÚ to ÚwÚ go thwough the x3 coop thing with me",
"I'm weawwy x3 stwuggwing ÚwÚ to ÚwÚ put this stowy t-toghethew, you we'we chiwwing with a dude who h-h-has decided that woman sucks",
"nyo ;;w;; thewe h-h-has b-been this wockdown in the x3 Nyethewwands so check out ^-^ this site: https://www.who.int/health-topics :3",
"wow UwU you'we owd as fuck, UwU you'we basicawwy :3 my gwandpa you knyow! UwU",
];
const originalWords = [
"Stabbed",
"Tonight",
"Through",
"Struggling",
"Netherlands",
"Grandpa",
];
const uwuifiedWords = [
"Stabbed",
"Tonyight",
"Thwough",
"Stwuggwing",
"Nyethewwands",
"Gwandpa",
];
Deno.test(`Uwufy words & check for inconsistency`, () => {
const transformedWords = originalWords.map((word) =>
uwuifier.uwuifyWords(word)
);
assertEquals(transformedWords, uwuifiedWords);
});
Deno.test("Uwufy sentences & check for inconsistency", () => {
const transformedSentences = originalSentences.map((sentence) =>
uwuifier.uwuifySentence(sentence)
);
assertEquals(transformedSentences, uwuifiedSentences);
});
Deno.test("Check consistency of number generator", () => {
const firstSample = new Seed("test").random();
const secondSample = new Seed("test").random();
assertEquals(firstSample, secondSample);
});