import 'package:test/test.dart'; import 'package:platform_support/platform_support.dart'; void main() { group('HtmlString', () { test('creates instance from string', () { final html = HtmlString('
Hello
'); expect(html.toString(), equals('Hello
')); }); test('creates instance using from factory', () { final html = HtmlString.from('Hello
'); expect(html.toString(), equals('Hello
')); }); test('creates empty instance', () { expect(HtmlString.empty.toString(), equals('')); }); test('implements Htmlable interface', () { final html = HtmlString('Hello
'); expect(html.toHtml(), equals('Hello
')); }); test('preserves raw HTML', () { final html = HtmlString('Hello World!
'); expect(html.toString(), equals('Hello World!
')); }); test('compares equal instances', () { final html1 = HtmlString('Hello
'); final html2 = HtmlString('Hello
'); final html3 = HtmlString('World
'); expect(html1, equals(html2)); expect(html1, isNot(equals(html3))); }); test('provides consistent hash codes', () { final html1 = HtmlString('Hello
'); final html2 = HtmlString('Hello
'); final html3 = HtmlString('World
'); expect(html1.hashCode, equals(html2.hashCode)); expect(html1.hashCode, isNot(equals(html3.hashCode))); }); test('works with string interpolation', () { final html = HtmlString('World'); final result = 'Hello, $html!'; expect(result, equals('Hello, World!')); }); }); }