Skip to content

Commit 17f97ea

Browse files
author
begoldsm
committed
Fix bug in GetItemContent not using offset
Now GetItemContent properly uses offset and has error messaging to reflect its use.
1 parent 0aab638 commit 17f97ea

File tree

6 files changed

+821
-355
lines changed

6 files changed

+821
-355
lines changed

src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/ScenarioTests/AdlsTests.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,18 @@ function Test-DataLakeStoreFileSystem
204204
Assert-AreEqual "File" $result.Type
205205
Assert-AreEqual $($content.length*2) $result.Length
206206

207+
# Preview content from the file
208+
$previewContent = Get-AzureRMDataLakeStoreItemContent -Account $accountName -Path $concatFile
209+
Assert-AreEqual $($content.length*2) $previewContent.Length
210+
211+
# Preview a subset of the content
212+
$previewContent = Get-AzureRMDataLakeStoreItemContent -Account $accountName -Path $concatFile -Offset 2
213+
Assert-AreEqual $(($content.length*2) - 2) $previewContent.Length
214+
215+
# Preview a subset with a specific length
216+
$previewContent = Get-AzureRMDataLakeStoreItemContent -Account $accountName -Path $concatFile -Offset 2 -Length $content.Length
217+
Assert-AreEqual $content.length $previewContent.Length
218+
207219
# Import and get file
208220
$localFileInfo = Get-ChildItem $fileToCopy
209221
$result = Import-AzureRmDataLakeStoreItem -Account $accountName -Path $fileToCopy -Destination $importFile

0 commit comments

Comments
 (0)