]> gitweb.factorcode.org Git - factor.git/blob - extra/lint/lint-tests.factor
Update actions, because Node.js 16 actions are deprecated, to Node.js 20
[factor.git] / extra / lint / lint-tests.factor
1 USING: io lint kernel math sequences tools.test ;
2 IN: lint.tests
3
4 ! Don't write code like this
5 : lint1 ( obj -- ) [ "hi" print ] [ ] if ; ! when
6
7 { { { lint1 { [ [ ] if ] } } } } [ \ lint1 lint-word ] unit-test
8
9 ! : lint2 ( a b -- b a b ) dup -rot ; ! tuck
10
11 ! [ { { lint2 { [ dup -rot ] } } } ] [ \ lint2 lint-word ] unit-test
12
13 : lint3 ( seq -- seq ) [ 0 swap nth 1 + ] map ;
14
15 { { { lint3 { [ 0 swap nth ] } } } } [ \ lint3 lint-word ] unit-test