about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_when_in_table.txt
blob: 6d3591f69c60c91706581bc6ba1078f509712530 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Test when expression in table */

// Simple when expression
classifier : {
    classify: x -> when x is
        0 then "zero"
        _ then "other"
};

// Test it
..out "=== WHEN IN TABLE TEST ===";
result : classifier.classify 0;
..out result;