VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/functions/insert@ 3154

Last change on this file since 3154 was 2413, checked in by bird, 15 years ago

copyright year update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1# $Id: insert 2413 2010-09-11 17:43:04Z bird $ -*-perl-*-
2## @file
3# $(insert in, str[, n[, length[, pad]]])
4#
5
6#
7# Copyright (c) 2008-2010 knut st. osmundsen <[email protected]>
8#
9# This file is part of kBuild.
10#
11# kBuild is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 3 of the License, or
14# (at your option) any later version.
15#
16# kBuild is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with kBuild. If not, see <http://www.gnu.org/licenses/>
23#
24#
25
26$description = "Tests the $(insert ) function";
27
28$details = "Testing edges and some simple stuff.";
29
30if ($is_kmk) {
31
32 # TEST #0 - check that the feature is present.
33 # --------------------------------------------
34 run_make_test('
35ifneq ($(insert a,b),ab)
36$(error sub-test 0 failed)
37endif
38.PHONY: all
39all: ; @:
40',
41'',
42'');
43
44 # TEST #1 - the real test.
45 # ------------------------
46 run_make_test('
47ifneq ($(insert a,b,1),ab)
48$(error sub-test 0 failed)
49endif
50ifneq ($(insert a,b,2),ba)
51$(error sub-test 1 failed)
52endif
53ifneq ($(insert a,b,3),b a)
54$(error sub-test 2 failed)
55endif
56ifneq ($(insert a,b,0),ba)
57$(error sub-test 3 failed)
58endif
59ifneq ($(insert a,b,-1),ab)
60$(error sub-test 4 failed)
61endif
62ifneq ($(insert a,b,-2),ab)
63$(error sub-test 5 failed)
64endif
65ifneq ($(insert a,b,-10),ab)
66$(error sub-test 6 failed)
67endif
68
69ifneq ($(insert a,b,-10,0),b)
70$(error sub-test 10 failed)
71endif
72ifneq ($(insert aAAA,b,4,1),b a)
73$(error sub-test 11 failed)
74endif
75ifneq ($(insert a,bBbBbBb,4,4),bBba BbBb)
76$(error sub-test 12 failed)
77endif
78
79ifneq ($(insert a,bBbBbBb,4,4,z),bBbazzzBbBb)
80$(error sub-test 20 failed)
81endif
82ifneq ($(insert a,bBbBbBb,4,4,xy),bBbaxyxBbBb)
83$(error sub-test 21 failed)
84endif
85ifneq ($(insert a,bBbBbBb,4,4,xyz),bBbaxyzBbBb)
86$(error sub-test 22 failed)
87endif
88ifneq ($(insert a,bBbBbBb,4,4,xyzXYZ),bBbaxyzBbBb)
89$(error sub-test 23 failed)
90endif
91ifneq ($(insert a,bBbBbBb,4,4,),bBba BbBb)
92$(error sub-test 24 failed)
93endif
94
95.PHONY: all
96all: ; @:
97',
98'',
99'');
100}
101
102
103
104# Indicate that we're done.
1051;
106
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette