diff -Nru libept-0.5.26/debian/changelog libept-0.5.27/debian/changelog
--- libept-0.5.26/debian/changelog	2008-10-15 19:26:37.000000000 +0100
+++ libept-0.5.27/debian/changelog	2009-08-03 15:49:38.000000000 +0100
@@ -1,3 +1,10 @@
+libept (0.5.27) unstable; urgency=low
+
+  * Applied patch by Julian Andres Klode:
+     + Fix test suite on apt 0.7.22, which supports Enhances (Closes: #539331)
+
+ -- Enrico Zini <enrico@debian.org>  Mon, 03 Aug 2009 15:49:25 +0100
+
 libept (0.5.26) unstable; urgency=low
 
   * Disable Xapian quality cutoff to make the results more deterministic
diff -Nru libept-0.5.26/ept/core/apt.test.h libept-0.5.27/ept/core/apt.test.h
--- libept-0.5.26/ept/core/apt.test.h	2008-06-27 11:26:10.000000000 +0100
+++ libept-0.5.27/ept/core/apt.test.h	2009-08-03 15:48:54.000000000 +0100
@@ -50,8 +50,15 @@
     }
 
     Test packageCount() {
+#if APT_PKG_MAJOR > 4 || (APT_PKG_MAJOR == 4 && APT_PKG_MINOR >= 8)
+        // libapt-pkg 4.8 (apt 0.7.22) supports Enhances, which adds one more
+        // package to the list.
+        assert_eq( list::count( pkgs.list< package::Name >() ),
+                   3778 );
+#else
         assert_eq( list::count( pkgs.list< package::Name >() ),
                    3777 );
+#endif
     }
 
     Test packageNameList() {

