about summary refs log tree commit diff stats
path: root/tree-sitter-yts/test
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-14 12:29:47 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-14 12:29:47 +0100
commita9a4ba60a37eb351d3ed872f1cfcf53e673be9ef (patch)
tree59ab6fe348e7e42c10c33799b5ff51433dc16842 /tree-sitter-yts/test
parentfix(yt_dlp/wrappers/info_json): Add missing fields to `Subtitle` (diff)
downloadyt-a9a4ba60a37eb351d3ed872f1cfcf53e673be9ef.tar.gz
yt-a9a4ba60a37eb351d3ed872f1cfcf53e673be9ef.zip
feat(tree-sitter-yts): Update to new tree-sitter version & improve parsing
Diffstat (limited to 'tree-sitter-yts/test')
-rw-r--r--tree-sitter-yts/test/corpus/comments.txt51
-rw-r--r--tree-sitter-yts/test/corpus/comments.txt.license9
-rw-r--r--tree-sitter-yts/test/corpus/comments_correct.txt27
-rw-r--r--tree-sitter-yts/test/corpus/comments_correct.txt.license9
-rw-r--r--tree-sitter-yts/test/corpus/duration.txt84
-rw-r--r--tree-sitter-yts/test/corpus/duration.txt.license9
-rw-r--r--tree-sitter-yts/test/corpus/flags.txt71
-rw-r--r--tree-sitter-yts/test/corpus/flags.txt.license9
-rw-r--r--tree-sitter-yts/test/corpus/flags_dash.txt29
-rw-r--r--tree-sitter-yts/test/corpus/flags_dash.txt.license9
-rw-r--r--tree-sitter-yts/test/corpus/missing_values.txt65
-rw-r--r--tree-sitter-yts/test/corpus/missing_values.txt.license9
-rw-r--r--tree-sitter-yts/test/corpus/url.txt84
-rw-r--r--tree-sitter-yts/test/corpus/url.txt.license9
14 files changed, 474 insertions, 0 deletions
diff --git a/tree-sitter-yts/test/corpus/comments.txt b/tree-sitter-yts/test/corpus/comments.txt
new file mode 100644
index 0000000..f194cb5
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/comments.txt
@@ -0,0 +1,51 @@
+================================================================================
+Parse multiple lines
+================================================================================
+
+pick 6z21 "Name" "2024-01-17" "A" "0m 0s" "url"
+pick 61f1 "Name2" "2024-01-16" "A2" "0m 0s" "url"
+
+# This is a comment
+# it contains information
+
+--------------------------------------------------------------------------------
+
+(source_file
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (comment)
+  (comment))
diff --git a/tree-sitter-yts/test/corpus/comments.txt.license b/tree-sitter-yts/test/corpus/comments.txt.license
new file mode 100644
index 0000000..d4d410f
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/comments.txt.license
@@ -0,0 +1,9 @@
+yt - A fully featured command line YouTube client
+
+Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of Yt.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tree-sitter-yts/test/corpus/comments_correct.txt b/tree-sitter-yts/test/corpus/comments_correct.txt
new file mode 100644
index 0000000..fd45e47
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/comments_correct.txt
@@ -0,0 +1,27 @@
+================================================================================
+Disregard comments in title
+================================================================================
+
+pick 6r94 "#100 Name" "2024-01-12" "A" "133m 29s" "url"
+
+--------------------------------------------------------------------------------
+
+(source_file
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote))))
diff --git a/tree-sitter-yts/test/corpus/comments_correct.txt.license b/tree-sitter-yts/test/corpus/comments_correct.txt.license
new file mode 100644
index 0000000..d4d410f
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/comments_correct.txt.license
@@ -0,0 +1,9 @@
+yt - A fully featured command line YouTube client
+
+Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of Yt.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tree-sitter-yts/test/corpus/duration.txt b/tree-sitter-yts/test/corpus/duration.txt
new file mode 100644
index 0000000..207e0a7
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/duration.txt
@@ -0,0 +1,84 @@
+================================================================================
+Parse multiple lines with different durations
+================================================================================
+
+pick 6f21 "Name" "2024-01-17" "A" "1h 0m" "url"
+pick 6z81 "Name2" "2024-01-16" "A2" "20m 02s" "url2"
+pick 6a84 "Name3" "2024-01-16" "A3" "20h 0m" "url3"
+pick 6b06 "Name4" "2024-01-16" "A4" "[No duration]" "url4"
+
+--------------------------------------------------------------------------------
+
+(source_file
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote))))
diff --git a/tree-sitter-yts/test/corpus/duration.txt.license b/tree-sitter-yts/test/corpus/duration.txt.license
new file mode 100644
index 0000000..d4d410f
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/duration.txt.license
@@ -0,0 +1,9 @@
+yt - A fully featured command line YouTube client
+
+Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of Yt.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tree-sitter-yts/test/corpus/flags.txt b/tree-sitter-yts/test/corpus/flags.txt
new file mode 100644
index 0000000..8c1d255
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/flags.txt
@@ -0,0 +1,71 @@
+================================================================================
+Correctly detect flags
+================================================================================
+
+watch --priority="-100" --speed 1 6z21 "Name" "2024-01-17" "A" "0m 0s" "url"
+watch -s 2 -l 'en,gr,fr' 61f1 "Name2" "2024-01-16" "A2" "0m 0s" "url"
+watch -s=2 -l='en,gr,fr' 61f1 "Name2" "2024-01-16" "A2" "0m 0s" "url"
+
+--------------------------------------------------------------------------------
+
+(source_file
+  (line
+    (command)
+    (flag)
+    (flag)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (flag)
+    (flag)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (flag)
+    (flag)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote))))
diff --git a/tree-sitter-yts/test/corpus/flags.txt.license b/tree-sitter-yts/test/corpus/flags.txt.license
new file mode 100644
index 0000000..d4d410f
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/flags.txt.license
@@ -0,0 +1,9 @@
+yt - A fully featured command line YouTube client
+
+Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of Yt.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tree-sitter-yts/test/corpus/flags_dash.txt b/tree-sitter-yts/test/corpus/flags_dash.txt
new file mode 100644
index 0000000..b9a5e7c
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/flags_dash.txt
@@ -0,0 +1,29 @@
+================================================================================
+Correctly detect flags
+================================================================================
+
+watch --subtitle-langs="" --speed 1 6z21 "Name" "2024-01-17" "A" "0m 0s" "url"
+
+--------------------------------------------------------------------------------
+
+(source_file
+  (line
+    (command)
+    (flag)
+    (flag)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote))))
diff --git a/tree-sitter-yts/test/corpus/flags_dash.txt.license b/tree-sitter-yts/test/corpus/flags_dash.txt.license
new file mode 100644
index 0000000..d4d410f
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/flags_dash.txt.license
@@ -0,0 +1,9 @@
+yt - A fully featured command line YouTube client
+
+Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of Yt.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tree-sitter-yts/test/corpus/missing_values.txt b/tree-sitter-yts/test/corpus/missing_values.txt
new file mode 100644
index 0000000..106602a
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/missing_values.txt
@@ -0,0 +1,65 @@
+================================================================================
+Parse multiple lines with missing information
+================================================================================
+
+pick    1 "no release date" "[No release date]" "A" "14m 0s" "http://gnu.org"
+pick    2 "no release date and author" "[No release date]" "[No author]" "14m 0s" "http://gnu.org"
+pick    3 "no release date, author and duration" "[No release date]" "[No author]" "[No duration]" "http://gnu.org"
+
+--------------------------------------------------------------------------------
+
+(source_file
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote))))
diff --git a/tree-sitter-yts/test/corpus/missing_values.txt.license b/tree-sitter-yts/test/corpus/missing_values.txt.license
new file mode 100644
index 0000000..d4d410f
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/missing_values.txt.license
@@ -0,0 +1,9 @@
+yt - A fully featured command line YouTube client
+
+Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of Yt.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tree-sitter-yts/test/corpus/url.txt b/tree-sitter-yts/test/corpus/url.txt
new file mode 100644
index 0000000..8236d6b
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/url.txt
@@ -0,0 +1,84 @@
+================================================================================
+Parse multiple lines with url
+================================================================================
+
+pick c221 "Name" "2024-01-17" "A" "0h 0m" "url"
+pick b181 "Name2" "2024-01-16" "A2" "0h 0m" "url2"
+pick a184 "Name3" "2024-01-16" "A3" "0h 0m" "url3"
+pick d206 "Name4" "2024-01-16" "A4" "0h 0m" "url4"
+
+--------------------------------------------------------------------------------
+
+(source_file
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote)))
+  (line
+    (command)
+    (id)
+    (title
+      (quote)
+      (quote))
+    (date
+      (quote)
+      (quote))
+    (author
+      (quote)
+      (quote))
+    (duration
+      (quote)
+      (quote))
+    (url
+      (quote)
+      (quote))))
diff --git a/tree-sitter-yts/test/corpus/url.txt.license b/tree-sitter-yts/test/corpus/url.txt.license
new file mode 100644
index 0000000..d4d410f
--- /dev/null
+++ b/tree-sitter-yts/test/corpus/url.txt.license
@@ -0,0 +1,9 @@
+yt - A fully featured command line YouTube client
+
+Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of Yt.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.