UNPKG

814 BJavaScriptView Raw
1const assert = require('assert')
2const linter = require('./../../../lib/index')
3const contractWith = require('./../../common/contract-builder').contractWith
4
5describe('Linter - func-name-mixedcase', () => {
6 it('should raise incorrect func name error', () => {
7 const code = contractWith('function AFuncName () public {}')
8
9 const report = linter.processStr(code, {
10 rules: { 'func-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 dot raise incorrect func name error', () => {
18 const code = contractWith('function aFunc1Nam23e () public {}')
19
20 const report = linter.processStr(code, {
21 rules: { 'func-name-mixedcase': 'error' }
22 })
23
24 assert.equal(report.errorCount, 0)
25 })
26})