5500: Add TASK_TEMPFAIL constant. shell_or_die always exits non-zero on error.
[arvados.git] / sdk / ruby / test / test_keep_manifest.rb
index 2ad0941e04b681485c7623cd316b5d4cf99de658..f1f1a530ceddbf35a9d5cd3066acc180eb4f254e 100644 (file)
@@ -58,6 +58,10 @@ class ManifestTest < Minitest::Test
     assert_equal(0, Keep::Manifest.new("").files_count)
   end
 
+  def test_empty_files_size
+    assert_equal(0, Keep::Manifest.new("").files_size)
+  end
+
   def test_empty_has_file?
     refute(Keep::Manifest.new("").has_file?(""))
   end
@@ -151,6 +155,15 @@ class ManifestTest < Minitest::Test
     refute(manifest.exact_file_count?(6), "+1 file count true")
   end
 
+  def test_files_size_multiblock
+    assert_equal(22, Keep::Manifest.new(MULTIBLOCK_FILE_MANIFEST).files_size)
+  end
+
+  def test_files_size_with_skipped_overlapping_data
+    manifest = Keep::Manifest.new(". #{random_block(9)} 3:3:f1 5:3:f2\n")
+    assert_equal(6, manifest.files_size)
+  end
+
   def test_has_file
     manifest = Keep::Manifest.new(MULTIBLOCK_FILE_MANIFEST)
     assert(manifest.has_file?("./repfile"), "one-arg repfile not found")