当前位置:网站首页>sacalatest AnyFunSuite:no implicits found for parameter pos
sacalatest AnyFunSuite:no implicits found for parameter pos
2022-08-02 03:28:00 【Code_LT】
Idea 中 如果加载scalatest的jar包后,一切顺利,当你写下如下代码的时候,会提示你no implicits found for parameter pos在test(){..}(这里报错)
。查了各种资料都没有怎么填pos这个位置的方法。且示例都不用写pos。
例如如下示例是可以运行的:
import org.scalatest.funsuite
class MyTest extends funsuite.AnyFunSuite {
val s = "a b c d"
test("长度大于4"){
assert(s.length > 4)
}
}
报错原因
新建的是scala工程,仅导入一个scalatest-funsuite_2.11-3.2.0.jar的包是不够的,还要导入scalatest-compatible-3.2.0.jar和scalatest-core_2.11-3.2.0.jar包。这样才有pos的隐式转换能力。
更简单的方法
改建scala的pom工程,然后加如下依赖即可,工程会自动加载funsuite,core,compatible 包
<dependencies>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-funsuite_2.11</artifactId>
<version>3.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
边栏推荐
猜你喜欢
laravel 写api接口时 session获取不到处理办法
Solve the problem that the 5+APP real machine test cannot access the background (same local area network)
自定义ViewGroup实现搜索栏历史记录流式布局
【一句话攻略】彻底理解JS中的回调(Callback)函数
Glide使用及原理分析
Two-Stream Convolutional Networks for Action Recognition in Videos双流网络论文精读
Larave 自定义公共函数以及引入使用
属性动画的使用和原理解析
阿里技术官手码12W字面试小册
18张图,直观理解神经网络、流形和拓扑
随机推荐
财产清查概述、 全面清查的情况、局部清查的情况、财产清查的方法、财产清查结果的处理
Laravel 登录,中间件和路由分组
Debian 12 Bookworm 尝鲜记
功能强大的黑科技网站--10连
Dart-Flutter DateTime日期转换
云安全笔记:云原生全链路加密
ArrayList LinkList效率对比
Mysql创建索引
mysql 原生语句点滴学习记录
解密:链动2+1的商业模式
SGDP(1)——猜数字游戏
kotlin语法总结(二)
laravel 查询数据库获取结果如何判断是否为空?
uniapp发布到微信小程序:分包、删减代码全过程
TimeSformer视频理解框架:视频理解中的Transformer
The first time to tear the code by hand, how to solve the problem of full arrangement
OpenCore 黑苹果安装教程
同时安装VirtualBox和VMware,虚拟机如何上网
Vision Transformer(ViT)论文精读和Pytorch实现代码解析
redo log与binlog间的破事