OSDN Git Service

t: fix plugins/preprocessor test
authorhylom <hylom@users.sourceforge.jp>
Wed, 6 Mar 2019 05:47:50 +0000 (14:47 +0900)
committerhylom <hylom@users.sourceforge.jp>
Wed, 6 Mar 2019 05:47:50 +0000 (14:47 +0900)
src/newslash_web/t/plugins/preprocessor.t

index c60242d..d3302ba 100644 (file)
@@ -34,6 +34,12 @@ if ($content) {
     my $md5_path = $pp->get_md5_path($path);
     is($md5_path, $pp->_add_md5_to_path($content->{path}, $content->{md5}), "get valid md5path");
 
+    # check ggziped content
+    my $gunzipped;
+    my $c = $content->{gz_content};
+    gunzip(\$c, \$gunzipped);
+    ok(Encode::decode_utf8($gunzipped) eq $content->{content}, "valid gzipped content");
+
     # expire all cache
     $pp->expire_cache($md5_path, "all");
     my $content_nocache = $pp->get_content("$md5_path");
@@ -51,19 +57,8 @@ if ($content) {
     is_deeply($content_nocache, $content, "valid nocache read");
     is_deeply($content_cached, $content, "valid cached read");
     is_deeply($content_kvs, $content, "valid kvs cached read");
-
-    # check gziped content
-    my $gunzipped;
-    my $c = $content_nocache->{gz_content};
-    gunzip(\$c, \$gunzipped);
-    ok(Encode::decode_utf8($gunzipped) eq $content_nocache->{content}, "valid gzipped content_nocache");
-
-    $c = $content_kvs->{gz_content};
-    gunzip(\$c, \$gunzipped);
-    ok(Encode::decode_utf8($gunzipped) eq $content_kvs->{content}, "valid gzipped content_kvs");
-
+}
 
 
-}
 
 done_testing();