Skip to content

Commit 40e5aad

Browse files
author
Swamp Ig
committed
Completed tests
1 parent 979ec0a commit 40e5aad

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-0
lines changed

Tests/ValueEdit.cfg

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
MMTEST
3+
{
4+
name = valueEdit
5+
MODULE
6+
{
7+
name = module1
8+
multiVal = one
9+
multiVal = two
10+
numeric = 0
11+
}
12+
}
13+
14+
// Adds value to module2
15+
@MMTEST[valueEdit]
16+
{
17+
// Copy new module 2
18+
@MODULE[module1]
19+
{
20+
// Unindexed
21+
@name = module2
22+
// Unindexed for multi - defaults to zero
23+
@multiVal = oneEdit
24+
// regexp with index
25+
@multiVal,1 ^= :tw:mo:
26+
// Arithmetic
27+
@numeric += 5
28+
@numeric *= 20
29+
}
30+
}
31+
32+
MMTEST_EXPECT
33+
{
34+
MMTEST
35+
{
36+
name = valueEdit
37+
MODULE
38+
{
39+
name = module2
40+
multiVal = oneEdit
41+
multiVal = moo
42+
numeric = 100
43+
}
44+
}
45+
}

Tests/ValueInsert.cfg

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
MMTEST
3+
{
4+
name = valueInsert
5+
MODULE
6+
{
7+
name = module1
8+
multiVal = one
9+
multiVal = two
10+
numeric = 0
11+
}
12+
}
13+
14+
// Adds value to module2
15+
@MMTEST[valueInsert]
16+
{
17+
// Copy new module 2
18+
@MODULE[module1]
19+
{
20+
// Unindexed
21+
multiVal = three
22+
// Indexed
23+
multiVal,0 = zero
24+
// Indexed off end
25+
multiVal,999 = four
26+
}
27+
}
28+
29+
MMTEST_EXPECT
30+
{
31+
MMTEST
32+
{
33+
name = valueInsert
34+
MODULE
35+
{
36+
name = module1
37+
numeric = 0
38+
multiVal = zero
39+
multiVal = one
40+
multiVal = two
41+
multiVal = three
42+
multiVal = four
43+
}
44+
}
45+
}

Tests/ValueReplace.cfg

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
MMTEST
3+
{
4+
name = valueReplace
5+
MODULE
6+
{
7+
name = module1
8+
multiVal = one
9+
multiVal = two
10+
numeric = 0
11+
}
12+
}
13+
14+
// Adds value to module2
15+
@MMTEST[valueReplace]
16+
{
17+
// Copy new module 2
18+
@MODULE[module1]
19+
{
20+
// Replace has by nature pretty limited capabilities
21+
// value present
22+
%multiVal = replaced
23+
// Value not present
24+
%hedgehog = spiky
25+
}
26+
}
27+
28+
MMTEST_EXPECT
29+
{
30+
MMTEST
31+
{
32+
name = valueReplace
33+
MODULE
34+
{
35+
name = module1
36+
numeric = 0
37+
multiVal = replaced
38+
hedgehog = spiky
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)