Skip to content

Commit 6ef08df

Browse files
committed
Renamed *Utf16 and *UriComponent methods to fit naming guidelines
1 parent 7b2adfe commit 6ef08df

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/LZStringVBNet/LZString.vb

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333

3434
End Function
3535

36-
Public Shared Function CompressToUTF16(input As String) As String
36+
Public Shared Function CompressToUtf16(input As String) As String
3737

3838
If String.IsNullOrEmpty(input) Then Return String.Empty
3939

4040
Return Compress(input, 15, Function(a) ChrW(a + 32))
4141

4242
End Function
43-
Public Shared Function DecompressFromUTF16(compressed As String) As String
43+
Public Shared Function DecompressFromUtf16(compressed As String) As String
4444

4545
If String.IsNullOrEmpty(compressed) Then Return String.Empty
4646

@@ -86,14 +86,14 @@
8686

8787
End Function
8888

89-
Public Shared Function CompressToEncodedURIComponent(input As String) As String
89+
Public Shared Function CompressToEncodedUriComponent(input As String) As String
9090

9191
If input Is Nothing Then Return String.Empty
9292

9393
Return Compress(input, 6, Function(a) KeyStrUriSafe(a))
9494

9595
End Function
96-
Public Shared Function DecompressFromEncodedURIComponent(input As String) As String
96+
Public Shared Function DecompressFromEncodedUriComponent(input As String) As String
9797

9898
If input Is Nothing Then Return String.Empty
9999
If String.IsNullOrEmpty(input) Then Return Nothing

tests/LZStringVBNet.Tests/LZStringTests.vb

+12-12
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ Public Class LZStringTests
5555

5656
End Sub
5757
<TestMethod()>
58-
Public Sub TestCompressToUTF16()
58+
Public Sub TestCompressToUtf16()
5959

60-
Assert.AreEqual("ɢ䰭䰾恔@㯄ʓFȱ ", LZString.CompressToUTF16("Hello, world!"))
60+
Assert.AreEqual("ɢ䰭䰾恔@㯄ʓFȱ ", LZString.CompressToUtf16("Hello, world!"))
6161

6262
End Sub
6363
<TestMethod()>
64-
Public Sub TestDecompressFromUTF16()
64+
Public Sub TestDecompressFromUtf16()
6565

66-
Assert.AreEqual("Hello, world!", LZString.DecompressFromUTF16("ɢ䰭䰾恔@㯄ʓFȱ "))
66+
Assert.AreEqual("Hello, world!", LZString.DecompressFromUtf16("ɢ䰭䰾恔@㯄ʓFȱ "))
6767

6868
End Sub
6969
<TestMethod()>
70-
Public Sub TestCompressesAndDecompressesAllPrintableUTF16Characters()
70+
Public Sub TestCompressesAndDecompressesAllPrintableUtf16Characters()
7171

7272
' This unit test is based off of this unit test:
7373
' https://github.com/pieroxy/lz-string/blob/b2e0b270a9f3cf330b778b777385fcba384a1a02/tests/lz-string-spec.js#L53
@@ -125,7 +125,7 @@ Public Class LZStringTests
125125

126126
End Sub
127127
<TestMethod()>
128-
Public Sub TestCompressToUint8Array()
128+
Public Sub TestCompressToUInt8Array()
129129

130130
Dim expectedBytes As Byte() = {4, 133, 48, 54, 96, 246, 3, 64, 4, 14, 233, 1, 57, 128, 38, 4, 34, 0}
131131
Dim actualBytes As Byte() = LZString.CompressToUInt8Array("Hello, world!")
@@ -134,7 +134,7 @@ Public Class LZStringTests
134134

135135
End Sub
136136
<TestMethod()>
137-
Public Sub TestDecompressFromUint8Array()
137+
Public Sub TestDecompressFromUInt8Array()
138138

139139
Dim bytes As Byte() = {4, 133, 48, 54, 96, 246, 3, 64, 4, 14, 233, 1, 57, 128, 38, 4, 34, 0}
140140

@@ -143,29 +143,29 @@ Public Class LZStringTests
143143
End Sub
144144

145145
<TestMethod()>
146-
Public Sub TestCompressToEncodedURIComponentAllCharactersAreURISafe()
146+
Public Sub TestCompressToEncodedUriComponentAllCharactersAreURISafe()
147147

148148
' This unit test is based off of this unit test:
149149
' https://github.com/pieroxy/lz-string/blob/b2e0b270a9f3cf330b778b777385fcba384a1a02/tests/lz-string-spec.js#L131
150150

151151
Dim testString As String = GetRandomTestString()
152-
Dim compressed As String = LZString.CompressToEncodedURIComponent(testString)
153-
Dim decompressed As String = LZString.DecompressFromEncodedURIComponent(compressed)
152+
Dim compressed As String = LZString.CompressToEncodedUriComponent(testString)
153+
Dim decompressed As String = LZString.DecompressFromEncodedUriComponent(compressed)
154154

155155
Assert.AreEqual(-1, compressed.IndexOf("="c))
156156
Assert.AreEqual(-1, compressed.IndexOf("/"c))
157157
Assert.AreEqual(testString, decompressed)
158158

159159
End Sub
160160
<TestMethod()>
161-
Public Sub TestCompressToEncodedURIComponentPlusAndSpaceAreInterchangeable()
161+
Public Sub TestCompressToEncodedUriComponentPlusAndSpaceAreInterchangeable()
162162

163163
' This unit test is based off of this unit test:
164164
' https://github.com/pieroxy/lz-string/blob/b2e0b270a9f3cf330b778b777385fcba384a1a02/tests/lz-string-spec.js#L144
165165

166166
Dim testString As String = GetTestString()
167167
Dim compressed As String = "CIVwTglgdg5gBAFwIYIQezdGAaO0DWeAznlAFYCmAxghQCanqIAWFcR 0u0ECEKWOEih4AtqJBQ2YCkQAOaKEQq5hDKhQA2mklSTb6cAESikVMGjnMkMWUbii0ANzbQmCVkJlIhUBkYoUOBA5ew9XKHwAOjgAFU9Tc0trW10kMDAAT3Y0UTY0ADMWCMJ3TwAjNDpMgHISTUzRKzgoKtlccpAEHLyWIPS2AogDBgB3XmZSQiJkbLku3ApRcvo6Q2hi9k4oGPiUOrhR627TfFlN5FQMOCcIIghyzTZJNbBNjmgY4H1mNBB7tgAVQgLjA9wQtRIAEEnlQ4AAxfRnKDWUTEOBrFyaSyCHzoOQQPSaODmQJojxBUZoMD4EjlbLIMC2PiwTaJCxWGznCndawuOAyUzQQxBcLsXj5Ipiy7oNAxAByFFGDjMHJS50c-I2TCoiiIIF6YrkMlufyIDTgBJgeSgCAAtEMRiqkpzUr4GOERKIIDAwCg2GU2A0mpNWmsiIsXLaQPoLchtvBY5tqmxxh5iqIYkYAOqsES6prpQS8RBoOCaJDKMB28qVwwy66C5z6bgiI6EyaZP7sCgBirgJS4MVEPQZLBDiqaO60MGtlh3El13CjCg1fnhn1SBg OhgEDwHkYtCyKA1brebTZPlsCRUSaFAp2xnMuAUAoFagIbD2TxEJAQOgs2zVcZBaNBumfCgWUTKBskKTZWjAUxiQ fMtB0XAiDLLsQEORQzx7NgfGxbp4OgAoK3EARFBiABJEQCjML84FrZQGEUTZjTQDQiBIQ8VxqUCmJjS9gnuWBlzYOh8Ig5gCGKUDxm0FiiNg0gKKQKi A4-plLUPBuipEBNG3GgRItFZfD4O1yMo0x0CyKIgAAA$$"
168-
Dim decompressed As String = LZString.DecompressFromEncodedURIComponent(compressed)
168+
Dim decompressed As String = LZString.DecompressFromEncodedUriComponent(compressed)
169169

170170
Assert.AreEqual(testString, decompressed)
171171

0 commit comments

Comments
 (0)