| 1 |
# |
| 2 |
# This file is part of the LibreOffice project. |
| 3 |
# |
| 4 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 5 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 6 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 7 |
# |
| 8 |
|
| 9 |
use strict; |
| 10 |
use warnings; |
| 11 |
|
| 12 |
use Test::More; |
| 13 |
|
| 14 |
use lib '.'; |
| 15 |
|
| 16 |
use installer::profiles; |
| 17 |
|
| 18 |
my @input = map { "$_\n" } split "\n", <<'END'; |
| 19 |
[foo] |
| 20 |
1 |
| 21 |
NOT SEEN |
| 22 |
[bar] |
| 23 |
3 |
| 24 |
[foo] |
| 25 |
2 |
| 26 |
[bar] |
| 27 |
4 |
| 28 |
END |
| 29 |
|
| 30 |
my @expected = map { "$_\n" } split "\n", <<'END'; |
| 31 |
[foo] |
| 32 |
1 |
| 33 |
2 |
| 34 |
[bar] |
| 35 |
3 |
| 36 |
4 |
| 37 |
END |
| 38 |
|
| 39 |
my $result = installer::profiles::sorting_profile(\@input); |
| 40 |
|
| 41 |
is_deeply($result, \@expected); |
| 42 |
|
| 43 |
done_testing(); |