mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[Runner]Handle release tag with uppercase V during update (#33822)
## Summary of the Pull Request The latest fix pushed with tag `V0.82.1` (uppercase V) isn't detected by the PT internal updater. Handle release tag with uppercase V during update.
This commit is contained in:
committed by
GitHub
parent
d668a659b5
commit
a3e193e56e
@@ -58,6 +58,15 @@ namespace UnitTestsVersionHelper
|
|||||||
Assert::AreEqual(25ull, sut->minor);
|
Assert::AreEqual(25ull, sut->minor);
|
||||||
Assert::AreEqual(1ull, sut->revision);
|
Assert::AreEqual(1ull, sut->revision);
|
||||||
}
|
}
|
||||||
|
TEST_METHOD (stringConstructorShouldProperlyInitializationVersionNumbersWithUppercaseV)
|
||||||
|
{
|
||||||
|
auto sut = VersionHelper::fromString(L"V2.25.1");
|
||||||
|
Assert::IsTrue(sut.has_value());
|
||||||
|
|
||||||
|
Assert::AreEqual(2ull, sut->major);
|
||||||
|
Assert::AreEqual(25ull, sut->minor);
|
||||||
|
Assert::AreEqual(1ull, sut->revision);
|
||||||
|
}
|
||||||
TEST_METHOD (emptyStringNotAccepted)
|
TEST_METHOD (emptyStringNotAccepted)
|
||||||
{
|
{
|
||||||
auto sut = VersionHelper::fromString("");
|
auto sut = VersionHelper::fromString("");
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ struct Constants;
|
|||||||
template<>
|
template<>
|
||||||
struct Constants<char>
|
struct Constants<char>
|
||||||
{
|
{
|
||||||
static inline const char* V = "v";
|
static inline const char* LOWER_V = "v";
|
||||||
|
static inline const char* UPPER_V = "V";
|
||||||
static inline const char* DOT = ".";
|
static inline const char* DOT = ".";
|
||||||
static inline const char SPACE = ' ';
|
static inline const char SPACE = ' ';
|
||||||
};
|
};
|
||||||
@@ -26,7 +27,8 @@ struct Constants<char>
|
|||||||
template<>
|
template<>
|
||||||
struct Constants<wchar_t>
|
struct Constants<wchar_t>
|
||||||
{
|
{
|
||||||
static inline const wchar_t* V = L"v";
|
static inline const wchar_t* LOWER_V = L"v";
|
||||||
|
static inline const wchar_t* UPPER_V = L"V";
|
||||||
static inline const wchar_t* DOT = L".";
|
static inline const wchar_t* DOT = L".";
|
||||||
static inline const wchar_t SPACE = L' ';
|
static inline const wchar_t SPACE = L' ';
|
||||||
};
|
};
|
||||||
@@ -36,7 +38,8 @@ std::optional<VersionHelper> fromString(std::basic_string_view<CharT> str)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
str = left_trim<CharT>(trim<CharT>(str), Constants<CharT>::V);
|
str = left_trim<CharT>(trim<CharT>(str), Constants<CharT>::LOWER_V);
|
||||||
|
str = left_trim<CharT>(trim<CharT>(str), Constants<CharT>::UPPER_V);
|
||||||
std::basic_string<CharT> spacedStr{ str };
|
std::basic_string<CharT> spacedStr{ str };
|
||||||
replace_chars<CharT>(spacedStr, Constants<CharT>::DOT, Constants<CharT>::SPACE);
|
replace_chars<CharT>(spacedStr, Constants<CharT>::DOT, Constants<CharT>::SPACE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user