Skip to content

Commit 8c1efce

Browse files
committed
测试 xy_path_join()
[GitHub #348]
1 parent 262e71d commit 8c1efce

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

lib/xy.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* -------------------------------------------------------------
55
* Lib Authors : 曾奥然 <ccmywish@qq.com>
66
* | 郭恒 <2085471348@qq.com>
7-
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
8-
* | juzeon <skyjuzheng@gmail.com>
7+
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
8+
* | juzeon <skyjuzheng@gmail.com>
99
* | BingChunMoLi <bingchunmoli@bingchunmoli.com>
10+
* | AnonTokio <anontokio@163.com>
1011
* |
1112
* Created On : <2023-08-28>
12-
* Last Modified : <2026-03-18>
13+
* Last Modified : <2026-03-21>
1314
*
1415
*
1516
* xy: 襄阳、咸阳
@@ -32,7 +33,7 @@
3233
#ifndef XY_H
3334
#define XY_H
3435

35-
#define _XY_Version "v0.2.2.2-2026/03/18"
36+
#define _XY_Version "v0.2.3.0-2026/03/21"
3637
#define _XY_Maintain_URL "https://github.com/RubyMetric/chsrc/blob/dev/lib/xy.h"
3738
#define _XY_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc/blob/dev/lib/xy.h"
3839

src/chsrc-main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ chsrc_register_contributors ()
4242
{
4343
/* 项目创建者 */
4444
chef_register_contributor ("@ccmywish", "曾奥然", "ccmywish@qq.com", NULL);
45-
// ID 为 Gitee ID
45+
// 该注释下一行的用户 ID 为 Gitee ID
4646
chef_register_contributor ("@G_I_Y", "郭恒", "2085471348@qq.com", NULL);
4747

4848
/* 所有贡献者 (按参与贡献时间排序) */
@@ -72,12 +72,12 @@ chsrc_register_contributors ()
7272
chef_register_contributor ("@Mikachu2333", "Mikachu2333", "mikachu.23333@zohomail.com", NULL);
7373
chef_register_contributor ("@techoc", "Rui Yang", "techoc@foxmail.com", NULL);
7474
chef_register_contributor ("@BingChunMoLi", "BingChunMoLi", "bingchunmoli@bingchunmoli.com", NULL);
75-
chef_register_contributor ("@AnonTokio", "Anon Tokio", "anontokio@163.com", NULL);
76-
// 该 ID 为 Gitee ID
75+
// 该注释下一行的用户 ID 为 Gitee ID
7776
chef_register_contributor ("@hezonglun", "HeZongLun", "hezonglun123456@outlook.com", NULL);
7877
chef_register_contributor ("@Young-Lord", "LY", "ly-niko@qq.com", NULL);
7978
chef_register_contributor ("@MingriLingran", "MingriLingran", "i@linran.moe", NULL);
8079
chef_register_contributor ("@usernameisnull", "MaBing", "cumt_ttr@163.com", NULL);
80+
chef_register_contributor ("@AnonTokio", "Anon Tokio", "anontokio@163.com", NULL);
8181

8282
/**
8383
* AI贡献者:

test/xy.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Test Authors : 曾奥然 <ccmywish@qq.com>
66
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
77
* Created On : <2023-08-30>
8-
* Last Modified : <2025-08-27>
8+
* Last Modified : <2026-03-22>
99
*
1010
* Test xy.h
1111
* ------------------------------------------------------------*/
@@ -147,6 +147,16 @@ main (int argc, char const *argv[])
147147
assert_str (xy_normalize_path ("~/haha/test"), xy_parent_dir (" ~/haha/test/123"));
148148
assert_str (".", xy_parent_dir ("abc"));
149149

150+
if (xy.on_windows)
151+
{
152+
assert_str ("C:\\Users\\chsrc", xy_path_join ("C:\\Users", "chsrc"));
153+
}
154+
else
155+
{
156+
assert_str ("/usr/local/bin", xy_path_join ("/usr/local", "bin"));
157+
assert_str ("/usr/local/lib", xy_path_join ("/usr/local/", "lib"));
158+
}
159+
150160

151161

152162
XySeq_t *seq = xy_seq_new ();

0 commit comments

Comments
 (0)