mirror of
https://github.com/sigmasternchen/macrofuck
synced 2025-03-15 23:28:55 +00:00
test: Add test case for extracting value with map
This commit is contained in:
parent
2d0d7691d7
commit
963e57c995
2 changed files with 21 additions and 0 deletions
compiler/test/cases
11
compiler/test/cases/021e-map-extract-value.in
Normal file
11
compiler/test/cases/021e-map-extract-value.in
Normal file
|
@ -0,0 +1,11 @@
|
|||
var a = []{'a', 'b', 'c'};
|
||||
|
||||
var extract = 0;
|
||||
|
||||
map(i, v in a) {
|
||||
if (i == 1) {
|
||||
extract = v;
|
||||
}
|
||||
}
|
||||
|
||||
print(extract, '\n');
|
10
compiler/test/cases/021e-map-extract-value.out
Normal file
10
compiler/test/cases/021e-map-extract-value.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
>>>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]<[-<<<+>>>>+<]>[-<+>]<[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]<[-<<+>>>+<]>[-<+>]<[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]<[-<+>>+<]>[-<+>]
|
||||
<[-]
|
||||
>[-]>[-]+>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<[->-<]+>[<->[-]]<[<<[-]>>>[-]<<<<<<[->>>+>>>+<<<<<<]>>>>>>[-<<<<<<+>>>>>>]
|
||||
<[-]]
|
||||
<+>[-]+>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<[->-<]+>[<->[-]]<[<<[-]>>>[-]<<<<<[->>+>>>+<<<<<]>>>>>[-<<<<<+>>>>>]
|
||||
<[-]]
|
||||
<+>[-]+>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<[->-<]+>[<->[-]]<[<<[-]>>>[-]<<<<[->+>>>+<<<<]>>>>[-<<<<+>>>>]
|
||||
<[-]]
|
||||
<+
|
||||
[-]++++++++++<.>.
|
Loading…
Reference in a new issue