]> git.saurik.com Git - apt.git/blob - test/libapt/sourcelist_test.cc
allow options between command and -- on commandline
[apt.git] / test / libapt / sourcelist_test.cc
1 #include <config.h>
2
3 #include <apt-pkg/sourcelist.h>
4 #include <apt-pkg/fileutl.h>
5
6 #include <string>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <unistd.h>
10
11 #include <gtest/gtest.h>
12
13 #include "file-helpers.h"
14
15 class SourceList : public pkgSourceList {
16 public:
17 using pkgSourceList::ParseFileDeb822;
18 };
19
20 TEST(SourceListTest,ParseFileDeb822)
21 {
22 FileFd fd;
23 char * tempfile;
24 createTemporaryFile("parsefiledeb822", fd, &tempfile,
25 "Types: deb\n"
26 "URIs: http://ftp.debian.org/debian\n"
27 "Suites: stable\n"
28 "Sections: main\n"
29 "Description: short\n"
30 " long description that can be very long\n"
31 "\n"
32 "Types: deb\n"
33 "URIs: http://ftp.debian.org/debian\n"
34 "Suites: unstable\n"
35 "Sections: main non-free\n");
36 fd.Close();
37
38 SourceList sources;
39 EXPECT_EQ(2, sources.ParseFileDeb822(tempfile));
40 EXPECT_EQ(2, sources.size());
41
42 unlink(tempfile);
43 }