Skip to content

Commit

Permalink
feat: Support thanks.dev from FUNDING.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Hejsil committed Feb 24, 2025
1 parent 0f17d84 commit e526312
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Package.zig
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ fn fundingYmlToUrls(arena: std.mem.Allocator, string: []const u8) ![]const []con
.{ "patreon", "https://www.patreon.com/" },
.{ "open_collective", "https://opencollective.com/" },
.{ "polar", "https://polar.sh/" },
.{ "thanks_dev", "https://thanks.dev/" },
});

var tok = Tokenizer{ .str = blk: {
Expand Down Expand Up @@ -596,6 +597,10 @@ fn expectFundingUrls(funding_yml: []const u8, expected: []const []const u8) !voi
const len = @min(expected.len, actual.len);
for (expected[0..len], actual[0..len]) |e, a|
try std.testing.expectEqualStrings(e, a);
for (expected[len..]) |e|
try std.testing.expectEqualStrings(e, "");
for (actual[len..]) |a|
try std.testing.expectEqualStrings("", a);
try std.testing.expectEqual(expected.len, actual.len);
}

Expand Down Expand Up @@ -660,6 +665,7 @@ test fundingYmlToUrls {
\\liberapay: [test]
\\open_collective: [test]
\\polar: [test]
\\thanks_dev: [test]
,
&.{
"https://www.patreon.com/test",
Expand All @@ -668,6 +674,7 @@ test fundingYmlToUrls {
"https://liberapay.com/test",
"https://opencollective.com/test",
"https://polar.sh/test",
"https://thanks.dev/test",
},
);
try expectFundingUrls(
Expand Down

0 comments on commit e526312

Please sign in to comment.