UNPKG

812 BJavaScriptView Raw
1const assert = require('assert')
2const linter = require('./../../../lib/index')
3const contractWith = require('./../../common/contract-builder').contractWith
4
5describe('Linter - modifier-name-mixedcase', () => {
6 it('should raise modifier name error', () => {
7 const code = contractWith('modifier owned_by(address a) { }')
8
9 const report = linter.processStr(code, {
10 rules: { 'modifier-name-mixedcase': 'error' }
11 })
12
13 assert.equal(report.errorCount, 1)
14 assert.ok(report.messages[0].message.includes('mixedCase'))
15 })
16
17 it('should not raise modifier name error', () => {
18 const code = contractWith('modifier ownedBy(address a) { }')
19
20 const report = linter.processStr(code, {
21 rules: { 'modifier-name-mixedcase': 'error' }
22 })
23
24 assert.equal(report.errorCount, 0)
25 })
26})