* lp:~mvo/apt/add-glob-function:
[ntk/apt.git] / test / libapt / fileutl_test.cc
CommitLineData
488011fa
MV
1#include <apt-pkg/error.h>
2#include <apt-pkg/fileutl.h>
3
4#include "assert.h"
5#include <string>
6#include <vector>
7
8#include <stdio.h>
9#include <iostream>
10#include <stdlib.h>
11
12
13int main(int argc,char *argv[])
14{
15 std::vector<std::string> files;
16
17 // normal match
18 files = Glob("*.lst");
19 if (files.size() != 1)
20 {
21 _error->DumpErrors();
22 return 1;
23 }
24
25 // not there
26 files = Glob("xxxyyyzzz");
27 if (files.size() != 0 || _error->PendingError())
28 {
29 _error->DumpErrors();
30 return 1;
31 }
32
33 // many matches (number is a bit random)
34 files = Glob("*.cc");
35 if (files.size() < 10)
36 {
37 _error->DumpErrors();
38 return 1;
39 }
40
41 return 0;
42}