Skip to content

Commit

Permalink
add: cyrillic and numeric file naming
Browse files Browse the repository at this point in the history
  • Loading branch information
etogood committed Jul 3, 2024
1 parent 1f7d654 commit d11b0e2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Asv.Mavlink.Test/Microservices/AsvSdr/AsvSdrExTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ await Assert.ThrowsAsync<ArgumentException>( async () =>
catch (Exception e)
{
_testOutputHelper.WriteLine(e.ToString());
Assert.Equal("Record name 'Test*' not match regex '^[A-Za-z][A-Za-z0-9_\\- +]{2,28}$')", e.Message);
Assert.Equal("Record name 'Test*' not match regex '^[A-Za-zА-Яа-я0-9][A-Za-zА-Яа-я0-9_\\- +]{2,28}$')", e.Message);
throw;
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/Asv.Mavlink/Microservices/AsvAudio/AsvAudioHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class AsvAudioHelper
{
public const int MaxPacketStreamData = AsvAudioStreamPayload.DataMaxItemsCount;
public const int DeviceNameMaxLength = 16;
private const string DeviceNameRegexString = "^[A-Za-z][A-Za-z0-9_\\- +]{2,16}$";
private const string DeviceNameRegexString = "^[A-Za-zА-Яа-я0-9][A-Za-zА-Яа-я0-9_\\- +]{2,16}$";
private static readonly Regex RecordNameRegex = new(DeviceNameRegexString, RegexOptions.Compiled);

public static void CheckDeviceName(string name)
Expand Down
6 changes: 3 additions & 3 deletions src/Asv.Mavlink/Microservices/AsvSdr/AsvSdrHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ public static class AsvSdrHelper
public const int RecordTagValueLength = 8;

public const int RecordNameMaxLength = 28;
private const string RecordNameRegexString = "^[A-Za-z][A-Za-z0-9_\\- +]{2,28}$";
private const string RecordNameRegexString = "^[A-Za-zА-Яа-я0-9][A-Za-zА-Яа-я0-9_\\- +]{2,28}$";
private static readonly Regex RecordNameRegex = new(RecordNameRegexString, RegexOptions.Compiled);


public const int RecordTagNameMaxLength = 16;
private const string RecordTagNameRegexString = "^[A-Za-z][A-Za-z0-9_\\- +]{2,16}$";
private const string RecordTagNameRegexString = "^[A-Za-zА-Яа-я0-9][A-Za-zА-Яа-я0-9_\\- +]{2,16}$";
private static readonly Regex RecordTagNameRegex = new(RecordTagNameRegexString, RegexOptions.Compiled);


public const int CalibrationTableNameMaxLength = 28;
private const string CalibrationTableNameRegexString = "^[A-Za-z][A-Za-z0-9_\\- +]{2,28}$";
private const string CalibrationTableNameRegexString = "^[A-Za-zА-Яа-я0-9][A-Za-zА-Яа-я0-9_\\- +]{2,28}$";
private static readonly Regex CalibrationTableNameRegex = new(CalibrationTableNameRegexString, RegexOptions.Compiled);

public static void CheckCalibrationTableName(string name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Asv.Mavlink;
public static class MavParamExtHelper
{
public const int ParamExtNameMaxLength = 16;
private const string ParamExtNameRegexString = "^[A-Za-z][A-Za-z0-9_]{2,16}$";
private const string ParamExtNameRegexString = "^[A-Za-zА-Яа-я0-9][A-Za-zА-Яа-я0-9_]{2,16}$";
private static readonly Regex RecordNameRegex = new(ParamExtNameRegexString, RegexOptions.Compiled);

public static void CheckParamName(string name)
Expand Down

0 comments on commit d11b0e2

Please sign in to comment.