From 916ee3e012507ab6ce95d76bb23eff256dacb017 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Sat, 5 Jun 2021 16:17:56 +0900
Subject: [PATCH] Add link tests

---
 test/parser.ts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/test/parser.ts b/test/parser.ts
index ab9b4d8..14666a3 100644
--- a/test/parser.ts
+++ b/test/parser.ts
@@ -756,6 +756,28 @@ describe('FullParser', () => {
 			];
 			assert.deepStrictEqual(mfm.parse(input), output);
 		});
+
+		it('with brackets', () => {
+			const input = '[foo](https://example.com/foo(bar))';
+			const output = [
+				LINK(false, 'https://example.com/foo(bar)', [
+					TEXT('foo')
+				]),
+			];
+			assert.deepStrictEqual(mfm.parse(input), output);
+		});
+
+		it('with parent brackets', () => {
+			const input = '([foo](https://example.com/foo(bar)))';
+			const output = [
+				TEXT('('),
+				LINK(false, 'https://example.com/foo(bar)', [
+					TEXT('foo')
+				]),
+				TEXT(')'),
+			];
+			assert.deepStrictEqual(mfm.parse(input), output);
+		});
 	});
 
 	describe('fn v1', () => {
-- 
GitLab