11import { assertEquals } from "https://deno.land/[email protected] /testing/asserts.ts" ; 2- import { assertNumber } from "https://deno.land/x/unknownutil@v2.1.1 /mod.ts#^" ;
2+ import { assert , is } from "https://deno.land/x/unknownutil@v3.0.0 /mod.ts#^" ;
33import { test } from "https://deno.land/x/[email protected] /mod.ts" ; 44import * as cursor from "./cursor.ts" ;
55import { assertPosition , assertScreenPos , isScreenPos } from "./types.ts" ;
1515 await denops . call ( "setline" , 1 , "abcdef" ) ;
1616 await denops . cmd ( "norm gg4|mx6|mY2|" ) ;
1717
18- assertNumber ( await cursor . col ( denops , "." ) ) ;
18+ assert ( await cursor . col ( denops , "." ) , is . Number ) ;
1919 assertEquals ( await cursor . col ( denops , "." ) , 2 ) ;
2020 assertEquals ( await cursor . col ( denops , [ 1 , 2 ] ) , 2 ) ;
2121 assertEquals ( await cursor . col ( denops , [ 1 , "$" ] ) , 7 ) ;
2828 await denops . cmd ( "enew!" ) ;
2929 await denops . call ( "setline" , 1 , "\tab" ) ;
3030
31- assertNumber ( await cursor . virtcol ( denops , "." ) ) ;
31+ assert ( await cursor . virtcol ( denops , "." ) , is . Number ) ;
3232 assertEquals ( await cursor . virtcol ( denops , "." ) , 8 ) ;
3333 assertEquals ( await cursor . virtcol ( denops , [ 1 , 1 ] ) , 8 ) ;
3434 assertEquals ( await cursor . virtcol ( denops , [ 1 , "$" ] ) , 11 ) ;
@@ -45,10 +45,10 @@ test({
4545 const winid = await denops . call ( "bufwinid" , "%" ) as number ;
4646 await denops . call ( "setline" , 1 , [ "a" , "b" , "c" ] ) ;
4747
48- assertNumber ( await cursor . line ( denops , "." ) ) ;
48+ assert ( await cursor . line ( denops , "." ) , is . Number ) ;
4949 assertEquals ( await cursor . line ( denops , "." ) , 1 ) ;
5050 assertEquals ( await cursor . line ( denops , "$" ) , 3 ) ;
51- assertNumber ( await cursor . line ( denops , "." , winid ) ) ;
51+ assert ( await cursor . line ( denops , "." , winid ) , is . Number ) ;
5252 assertEquals ( await cursor . line ( denops , "." , winid ) , 1 ) ;
5353 } ,
5454 } ) ;
@@ -57,26 +57,26 @@ test({
5757 name : "wincol()" ,
5858 fn : async ( ) => {
5959 await denops . cmd ( "enew!" ) ;
60- assertNumber ( await cursor . wincol ( denops ) ) ;
60+ assert ( await cursor . wincol ( denops ) , is . Number ) ;
6161 } ,
6262 } ) ;
6363
6464 await t . step ( {
6565 name : "winline()" ,
6666 fn : async ( ) => {
6767 await denops . cmd ( "enew!" ) ;
68- assertNumber ( await cursor . winline ( denops ) ) ;
68+ assert ( await cursor . winline ( denops ) , is . Number ) ;
6969 } ,
7070 } ) ;
7171
7272 await t . step ( {
7373 name : "cursor()" ,
7474 fn : async ( ) => {
7575 await denops . cmd ( "enew!" ) ;
76- assertNumber ( await cursor . cursor ( denops , 1 , 2 ) ) ;
77- assertNumber ( await cursor . cursor ( denops , 1 , 2 , 3 ) ) ;
78- assertNumber ( await cursor . cursor ( denops , [ 1 , 2 , 3 ] ) ) ;
79- assertNumber ( await cursor . cursor ( denops , [ 1 , 2 , 3 , 4 ] ) ) ;
76+ assert ( await cursor . cursor ( denops , 1 , 2 ) , is . Number ) ;
77+ assert ( await cursor . cursor ( denops , 1 , 2 , 3 ) , is . Number ) ;
78+ assert ( await cursor . cursor ( denops , [ 1 , 2 , 3 ] ) , is . Number ) ;
79+ assert ( await cursor . cursor ( denops , [ 1 , 2 , 3 , 4 ] ) , is . Number ) ;
8080 } ,
8181 } ) ;
8282
@@ -123,11 +123,13 @@ test({
123123 name : "setpos" ,
124124 fn : async ( ) => {
125125 await denops . cmd ( "enew!" ) ;
126- assertNumber (
126+ assert (
127127 await cursor . setpos ( denops , "'b" , await cursor . getpos ( denops , "'a" ) ) ,
128+ is . Number ,
128129 ) ;
129- assertNumber (
130+ assert (
130131 await cursor . setpos ( denops , "'b" , await cursor . getcurpos ( denops ) ) ,
132+ is . Number ,
131133 ) ;
132134 } ,
133135 } ) ;
@@ -136,24 +138,24 @@ test({
136138 name : "byte2line" ,
137139 fn : async ( ) => {
138140 await denops . cmd ( "enew!" ) ;
139- assertNumber ( await cursor . byte2line ( denops , 1 ) ) ;
141+ assert ( await cursor . byte2line ( denops , 1 ) , is . Number ) ;
140142 } ,
141143 } ) ;
142144
143145 await t . step ( {
144146 name : "line2byte" ,
145147 fn : async ( ) => {
146148 await denops . cmd ( "enew!" ) ;
147- assertNumber ( await cursor . line2byte ( denops , 1 ) ) ;
149+ assert ( await cursor . line2byte ( denops , 1 ) , is . Number ) ;
148150 } ,
149151 } ) ;
150152
151153 await t . step ( {
152154 name : "diff_filler()" ,
153155 fn : async ( ) => {
154156 await denops . cmd ( "enew!" ) ;
155- assertNumber ( await cursor . diff_filler ( denops , 1 ) ) ;
156- assertNumber ( await cursor . diff_filler ( denops , "." ) ) ;
157+ assert ( await cursor . diff_filler ( denops , 1 ) , is . Number ) ;
158+ assert ( await cursor . diff_filler ( denops , "." ) , is . Number ) ;
157159 } ,
158160 } ) ;
159161 } ,
0 commit comments