]>
git.saurik.com Git - apt.git/blob - test/libapt/sourcelist_test.cc
3 #include <apt-pkg/sourcelist.h>
4 #include <apt-pkg/fileutl.h>
11 #include <gtest/gtest.h>
13 #include "file-helpers.h"
15 TEST(SourceListTest
,ParseFileDeb822
)
19 createTemporaryFile("parsefiledeb822.XXXXXX.sources", fd
, &tempfile
,
21 "URIs: http://ftp.debian.org/debian\n"
24 "Description: short\n"
25 " long description that can be very long\n"
28 "URIs: http://ftp.debian.org/debian\n"
30 "Components: main non-free\n");
33 pkgSourceList sources
;
34 EXPECT_EQ(true, sources
.Read(tempfile
));
35 EXPECT_EQ(2, sources
.size());
37 if (tempfile
.empty() == false)
38 unlink(tempfile
.c_str());