Skip to content

Commit c1e3522

Browse files
committed
podchecker
1 parent 143bc80 commit c1e3522

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ chsrc-ci-release
4141
xy
4242
fw
4343
README.md.bak*
44+
*.tmp
4445

4546
# Generated when testing (when there's a bug)
4647
nul

test/cli.pl

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
#!/usr/bin/env perl
22
# ---------------------------------------------------------------
33
# Test File : cli.pl
4-
# Test Authors : Aoran Zeng <[email protected]>
4+
# Test Authors : 曾奥然 <[email protected]>
55
# Contributors : Nil Null <[email protected]>
66
# Created On : <2024-06-05>
7-
# Last Modified : <2025-08-11>
7+
# Last Modified : <2025-09-27>
88
#
99
# 测试 chsrc 可执行文件
1010
# ---------------------------------------------------------------
1111

12+
=encoding utf8
13+
14+
本文件可以使用
15+
16+
$ podchecker .test\cli.pl
17+
18+
来检查 Pod 语法
19+
20+
$ pod2html .\test\cli.pl > CLI.html
21+
22+
来生成 HTML 文件
23+
24+
$ pod2markdown .\test\cli.pl > CLI.md
25+
26+
来生成 Markdown 文件
27+
28+
=over
29+
30+
=item C<=end> 的时候前面必须给一个空行,否则 podchecker 不认
31+
32+
=item 每一个 Pod block 必须用 C<=cut> 来终结,否则 VS Code 会把后续内容全部认为是 POD
33+
34+
=back
35+
=cut
36+
37+
38+
1239
use v5.38;
1340
use Test::More;
1441

@@ -23,8 +50,12 @@
2350
like `./chsrc help`, $help_str, 'chsrc help';
2451
like `./chsrc`, $help_str, 'chsrc';
2552

26-
=begin
53+
54+
=begin comment
55+
2756
测试 chsrc list
57+
58+
=end comment
2859
=cut
2960
my $list_str = qr/mirrorz\s*MirrorZ\s*.*\ntuna\s*TUNA/;
3061
like `./chsrc ls`, $list_str, 'chsrc ls';
@@ -33,8 +64,11 @@
3364
like `./chsrc list ware`, qr/brew\s*homebrew/, 'chsrc list ware';
3465

3566

36-
=begin
67+
=begin comment
68+
3769
测试 chsrc get
70+
71+
=end comment
3872
=cut
3973
my $get_null = qr/chsrc: 请提供想要查看源的目标名/;
4074
like `./chsrc get -no-color 2>&1`, $get_null, 'chsrc get -no-color';
@@ -62,16 +96,21 @@
6296
like `./chsrc get ruby`, $get_ruby, 'chsrc get ruby';
6397

6498

65-
=begin
99+
=begin comment
100+
66101
测试 chsrc measure
102+
103+
=end comment
67104
=cut
68105
my $measure_ruby = qr/Ruby China 社区/;
69106
like `./chsrc measure ruby`, $measure_ruby, 'chsrc measure ruby';
70107

71108

109+
=begin comment
72110
73-
=begin
74111
测试 chsrc set 以及 chsrc reset
112+
113+
=end comment
75114
=cut
76115
my $set_ruby_abcd = qr/镜像站.*不存在/;
77116
my $set_ruby_first = qr/全自动换源完成, 感谢镜像提供方/;

0 commit comments

Comments
 (0)