1 | const assert = require('assert')
|
2 | const linter = require('./../../../lib/index')
|
3 | const contractWith = require('./../../common/contract-builder').contractWith
|
4 |
|
5 | describe('Linter - func-param-name-mixedcase', () => {
|
6 | it('should raise incorrect func param name error', () => {
|
7 | const code = contractWith('function funcName (uint A) public {}')
|
8 |
|
9 | const report = linter.processStr(code, {
|
10 | rules: { 'func-param-name-mixedcase': 'error' }
|
11 | })
|
12 |
|
13 | assert.equal(report.errorCount, 1)
|
14 | assert.ok(report.messages[0].message.includes('param'))
|
15 | })
|
16 |
|
17 | it('should raise var name error for event arguments illegal styling', () => {
|
18 | const code = contractWith('event Event1(uint B);')
|
19 |
|
20 | const report = linter.processStr(code, {
|
21 | rules: { 'func-param-name-mixedcase': 'error' }
|
22 | })
|
23 |
|
24 | assert.equal(report.errorCount, 1)
|
25 | assert.ok(report.messages[0].message.includes('mixedCase'))
|
26 | })
|
27 | })
|