generated from vrchat-community/template-package
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avatar names with non-path-safe characters break builds
Fixes: #18
- Loading branch information
1 parent
40dcf08
commit f82fcdc
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using nadena.dev.ndmf; | ||
using NUnit.Framework; | ||
|
||
namespace UnitTests | ||
{ | ||
public class AvatarNameFilterTests | ||
{ | ||
[Test] | ||
public void TestAvatarNameFilter() | ||
{ | ||
Assert.AreEqual( | ||
"foo", | ||
BuildContext.FilterAvatarName("foo") | ||
); | ||
|
||
Assert.AreEqual( | ||
"_con", | ||
BuildContext.FilterAvatarName("con") | ||
); | ||
|
||
Assert.AreEqual( | ||
"_LPT4", | ||
BuildContext.FilterAvatarName("LPT4") | ||
); | ||
|
||
Assert.AreEqual( | ||
"_AUX.avatar", | ||
BuildContext.FilterAvatarName("AUX.avatar") | ||
); | ||
|
||
Assert.AreEqual( | ||
"foo_bar", | ||
BuildContext.FilterAvatarName("foo/bar") | ||
); | ||
|
||
Assert.AreEqual( | ||
"foo_bar_baz_quux", | ||
BuildContext.FilterAvatarName("foo\\bar?baz*quux") | ||
); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.