UNPKG

531 BJavaScriptView Raw
1const assert = require('assert')
2const linter = require('./../../../lib/index')
3const funcWith = require('./../../common/contract-builder').funcWith
4
5describe('Linter - use-forbidden-name', () => {
6 it('should raise forbidden name error', () => {
7 const code = funcWith('uint l = 0;')
8
9 const report = linter.processStr(code, {
10 rules: { 'no-unused-vars': 'error', 'use-forbidden-name': 'error' }
11 })
12
13 assert.equal(report.errorCount, 2)
14 assert.ok(report.messages[0].message.includes('Avoid to use'))
15 })
16})