@@ -8,30 +8,22 @@ local qcompat = require('queue.compat')
88test :ok (qcompat , ' queue compatibility layer exists' )
99
1010test :test (' *_version' , function (test )
11- test :plan (9 )
11+ test :plan (10 )
1212
1313 local split_version = qcompat .split_version
1414 local check_version = qcompat .check_version
1515
16- test :is_deeply (split_version (" 1.6.8-173" ), {" 1" , " 6" , " 8" , " 173" },
17- " check split_version 1" )
18- test :is_deeply (split_version (" 1.7.1-0" ), {" 1" , " 7" , " 1" , " 0" },
19- " check split_version 2" )
20- test :is_deeply (split_version (" 1.7.1" ), {" 1" , " 7" , " 1" },
21- " check split_version 3" )
22-
23- test :ok (check_version ({1 , 7 , 1 }, " 1.8.1-0" ),
24- " check supported version" )
25- test :ok (check_version ({1 , 7 , 1 }, " 1.7.1-0" ),
26- " check supported version" )
27- test :ok (check_version ({1 , 7 , 1 }, " 1.7.1-1" ),
28- " check supported version" )
29- test :ok (not check_version ({1 , 7 , 1 }, " 1.6.9" ),
30- " check unsupported version" )
31- test :ok (not check_version ({1 , 7 , 1 }, " 1.6.9-100" ),
32- " check unsupported version" )
33- test :ok (not check_version ({1 , 7 , 1 }, " 1.6.9-100" ),
34- " check unsupported version" )
16+ test :is_deeply (split_version (" 1.6.8-173" ), {" 1" , " 6" , " 8" , " 173" }, " check split_version 1" )
17+ test :is_deeply (split_version (" 1.7.1-0" ), {" 1" , " 7" , " 1" , " 0" }, " check split_version 2" )
18+ test :is_deeply (split_version (" 1.7.1" ), {" 1" , " 7" , " 1" }, " check split_version 3" )
19+
20+ test :is (check_version ({1 , 7 , 1 }, " 1.8.1-0" ), true , " check supported version" )
21+ test :is (check_version ({1 , 7 , 1 }, " 1.7.1-0" ), true , " check supported version" )
22+ test :is (check_version ({1 , 7 , 1 }, " 1.7.1-1" ), true , " check supported version" )
23+ test :is (check_version ({1 , 7 , 2 }, " 1.8.1" ), true , " check supported version" )
24+ test :is (check_version ({1 , 7 , 1 }, " 1.6.9" ), false , " check unsupported version" )
25+ test :is (check_version ({1 , 7 , 1 }, " 1.6.9-100" ), false , " check unsupported version" )
26+ test :is (check_version ({1 , 7 , 1 }, " 1.6.9-100" ), false , " check unsupported version" )
3527end )
3628
3729test :test (" check compatibility names" , function (test )
0 commit comments