Closed gaohuatao-1 closed 1 day ago
/test
@gaohuatao-1 Thanks for bringing this to runtime-rs. Could you mind adding some unit tests to the method?
/test
@justxuewei @Apokleos I have added a ut to the method. PTAL again, thanks.
/test
@Apokleos Hi, PTAL, Thanks.
Thx @gaohuatao-1 Compared with
CountFiles in kata runtime with golang
, this commit looks good to me. But I try to set thelimit < 0
(limit declared as i32), the UT fails. I think the argumentlimit: i32
in count_files() shoud be change aslimit: u32
, maybe it's another bug, what do you think ? @Apokleos
Thanks for your reply. I did the test: the input param limit of func count_files is smaller than zero and test_count_files is still passed. such as:
Could you please take a look again? Thanks a lot.
Thx @gaohuatao-1 Compared with
CountFiles in kata runtime with golang
, this commit looks good to me. But I try to set thelimit < 0
(limit declared as i32), the UT fails. I think the argumentlimit: i32
in count_files() shoud be change aslimit: u32
, maybe it's another bug, what do you think ? @Apokleos Thanks for your reply. I did the test: the input param limit of func count_files is smaller than zero and test_count_files is still passed. such as:Could you please take a look again? Thanks a lot.
what's about -2 ? IMO, if you set -1 the return value is -1 which looks same with the Ok(-1), but they are in fact not same, I think.
Thx @gaohuatao-1 Compared with
CountFiles in kata runtime with golang
, this commit looks good to me. But I try to set thelimit < 0
(limit declared as i32), the UT fails. I think the argumentlimit: i32
in count_files() shoud be change aslimit: u32
, maybe it's another bug, what do you think ? @Apokleos Thanks for your reply. I did the test: the input param limit of func count_files is smaller than zero and test_count_files is still passed. such as:Could you please take a look again? Thanks a lot.
what's about -2 ? IMO, if you set -1 the return value is -1 which looks same with the Ok(-1), but they are in fact not same, I think. -2 is ok, too. such as:
@Apokleos
When the total number of files observed is greater than limit, return -1 directly. runtime has fixed this bug, it should b ported to runtime-rs.
Fixes:#9829