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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
//! Centralized test fixtures and HTML constants
//!
//! This module provides standardized HTML test fixtures to eliminate
//! duplication across test files and examples.
/// Basic HTML structure with common elements
pub const BASIC_HTML: &str = r#"<!DOCTYPE html>
<html>
<head>
<title>Test Page</title>
<meta name="description" content="A simple test page">
</head>
<body>
<h1>Test Page</h1>
<p>This is a test page content.</p>
<a href="https://example.com">External link</a>
<img src="test.jpg" alt="Test image">
</body>
</html>"#;
/// Minimal HTML for simple tests
pub const MINIMAL_HTML: &str = r#"<!DOCTYPE html>
<html>
<head><title>Minimal</title></head>
<body><p>Minimal content</p></body>
</html>"#;
/// Malformed HTML for error testing
pub const MALFORMED_HTML: &str =
r#"<html><head><title>Test</head><body><p>Missing closing tags and malformed structure"#;
/// Comprehensive HTML with multiple elements
pub const COMPREHENSIVE_HTML: &str = r#"<!DOCTYPE html>
<html>
<head>
<title>Test Page</title>
<meta name="description" content="A simple test page">
</head>
<body>
<h1>Test Page</h1>
<p>This is a test page content.</p>
<a href="https://example.com">External link</a>
<img src="test.jpg" alt="Test image">
<form>
<label for="test">Test field</label>
<input type="text" id="test" name="test">
<button type="submit">Submit</button>
</form>
</body>
</html>"#;
/// HTML with structured headings
pub const STRUCTURED_HTML: &str = r#"<!DOCTYPE html>
<html>
<head><title>Structured Content</title></head>
<body>
<h1>Main Title</h1>
<h2>Section 1</h2>
<p>Content for section 1.</p>
<h2>Section 2</h2>
<p>Content for section 2.</p>
<h3>Subsection 2.1</h3>
<p>Subsection content.</p>
</body>
</html>"#;
/// HTML with media elements
pub const MEDIA_HTML: &str = r#"<!DOCTYPE html>
<html>
<head><title>Media Test</title></head>
<body>
<h1>Media Content</h1>
<img src="image1.jpg" alt="First image">
<img src="image2.jpg" alt="Second image">
<video src="video.mp4">Video content</video>
<audio src="audio.mp3">Audio content</audio>
</body>
</html>"#;
/// Large HTML document for performance testing
pub const LARGE_HTML: &str = r#"<!DOCTYPE html>
<html>
<head><title>Large Document</title></head>
<body>
<h1>Large Content</h1>
<div class="content">
<p>This is a large document with many paragraphs for testing performance.</p>
<p>Each paragraph contains sufficient text to test word counting and analysis.</p>
<p>The document includes multiple sections and various elements.</p>
<p>Content continues with more paragraphs to reach adequate size.</p>
<p>Performance testing requires substantial content volume.</p>
<p>Additional paragraphs ensure comprehensive analysis coverage.</p>
<p>The large document tests system behavior under load.</p>
<p>Multiple paragraphs provide realistic content scenarios.</p>
<p>Extensive content helps validate algorithm efficiency.</p>
<p>Final paragraphs complete the large document structure.</p>
</div>
</body>
</html>"#;
/// Simple blog post HTML for profile testing
pub const BLOG_HTML: &str = r#"<html>
<head><title>My Blog Post</title></head>
<body>
<h1>Blog Post</h1>
<p>Personal thoughts and experiences.</p>
</body>
</html>"#;
/// Product page HTML for e-commerce testing
pub const PRODUCT_HTML: &str = r#"<html>
<head><title>Amazing Product</title></head>
<body>
<h1>Product Name</h1>
<p>Product description with features and benefits.</p>
</body>
</html>"#;
/// News article HTML for news profile testing
pub const NEWS_HTML: &str = r#"<html>
<head><title>Breaking News</title></head>
<body>
<h1>News Headline</h1>
<p>Latest news update with factual information.</p>
</body>
</html>"#;
/// Sample article with proper structure
pub const SAMPLE_ARTICLE_HTML: &str = r#"<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sample Article</title>
<meta name="description" content="A well-structured article about web development.">
</head>
<body>
<h1>Web Development Best Practices</h1>
<p>This article covers essential best practices for modern web development.</p>
<h2>HTML Structure</h2>
<p>Proper HTML structure is crucial for accessibility and SEO. Always use semantic elements.</p>
<h2>Performance Optimization</h2>
<p>Optimize your website for fast loading times by minimizing resources and using modern techniques.</p>
<ul>
<li>Minimize HTTP requests</li>
<li>Optimize images</li>
<li>Use compression</li>
</ul>
<p>Following these practices will improve user experience and search engine rankings.</p>
</body>
</html>"#;
/// Unicode and emoji test content
pub const UNICODE_HTML: &str = r#"<!DOCTYPE html>
<html lang="ja">
<head><title>Unicode Test - こんにちは</title></head>
<body>
<h1>Unicode Content 🌍</h1>
<p>This page contains unicode: こんにちは世界 🚀 éñüíóáç ñáéíóú</p>
<p>Emoji content: 😀 🎉 🌟 💫 ⭐</p>
</body>
</html>"#;
/// Empty elements for edge case testing
pub const EMPTY_ELEMENTS_HTML: &str = r#"<!DOCTYPE html>
<html>
<head><title>Empty Elements</title></head>
<body>
<h1></h1>
<p></p>
<div></div>
<span></span>
<a href=""></a>
<img src="" alt="">
</body>
</html>"#;