This removes the exclusive from the res names and edge names. We now require that the names should be lists of strings, however they can still be single strings if that can be determined statically. Programmers should explicitly wrap their variables in a string by interpolation to force this, or in square brackets to force a list. The former is generally preferable because it generates a small function graph since it doesn't need to build a list.
43 lines
713 B
Plaintext
43 lines
713 B
Plaintext
-- main.mcl --
|
|
$st0 = struct{x1 => 1.0, x5 => 2.1, x15 => 3.2,}
|
|
$s0a = if $st0->x1 == 1.0 {
|
|
"passed0a"
|
|
} else {
|
|
"failed"
|
|
}
|
|
test "${s0a}" {}
|
|
$s0b = if $st0->x5 == 2.1 {
|
|
"passed0b"
|
|
} else {
|
|
"failed"
|
|
}
|
|
test "${s0b}" {}
|
|
$s0c = if $st0->x15 == 3.2 {
|
|
"passed0c"
|
|
} else {
|
|
"failed"
|
|
}
|
|
test "${s0c}" {}
|
|
|
|
$st1 struct{x1 float; x5 float; x15 float} = struct{x1 => 1.0, x5 => 2.1, x15 => 3.2,}
|
|
$s1 = if $st1->x5 == 2.1 {
|
|
"passed1"
|
|
} else {
|
|
"failed"
|
|
}
|
|
test "${s1}" {}
|
|
|
|
$st2 = struct{x1 => 1.0, x5 => 2.1, x15 => 3.2,}
|
|
$s2 = if $st2->x5 == 2.1 {
|
|
"passed2"
|
|
} else {
|
|
"failed"
|
|
}
|
|
test "${s2}" {}
|
|
-- OUTPUT --
|
|
Vertex: test[passed0a]
|
|
Vertex: test[passed0b]
|
|
Vertex: test[passed0c]
|
|
Vertex: test[passed1]
|
|
Vertex: test[passed2]
|