towerops/test/snmpkit/snmp_lib/mib
mayor 07977bc16f
test: add comprehensive tests for MIB.SnmpTokenizer
Added complete test coverage for MIB.SnmpTokenizer module (32.93% -> target higher):

**Tokenization Tests:**
- Empty input handling
- Simple MIB header (DEFINITIONS, BEGIN, END)
- Reserved word recognition (30+ SMI keywords tested)
- Identifier tokenization (lowercase atoms, uppercase variables)
- Number tokenization (integers, negative numbers, leading zeros, large numbers)
- String tokenization with quotes
- Special characters (::=, {}, (), commas, semicolons, dots)
- OID notation
- Complete OBJECT-TYPE definitions
- Access modifiers (read-only, read-write, not-accessible, read-create)
- SMI types (INTEGER, OCTET STRING, Counter32, Gauge32, TimeTicks, IpAddress)
- Hyphenated keywords (OBJECT-TYPE, MAX-ACCESS, MODULE-IDENTITY, etc.)

**Format and Syntax:**
- Whitespace handling (spaces, tabs, newlines)
- Comment handling (-- comments)
- Multiline input
- Line number tracking
- Token order preservation
- Complex MIB structures (IMPORTS, MODULE-IDENTITY, etc.)
- SIZE constraints
- SEQUENCE OF notation

**Error Handling:**
- format_error/1 for illegal characters
- Unterminated string errors
- Unterminated quote errors
- Unknown error formatting

**Edge Cases:**
- Very long identifiers (up to 200 chars)
- Many tokens (100+ identifiers)
- Deeply nested braces
- Mixed case keywords (case-sensitive)
- Empty strings
- Consecutive operators
- Tabs and mixed whitespace
- Numbers with leading zeros
- Very large numbers

**Reserved Word Coverage:**
- All common SMI/SMIv2 reserved words tested
- Distinction between reserved words and similar identifiers
- Case-sensitive recognition

40 new tests added
Test count: 1,264 -> 1,304 (all passing)
2026-02-06 08:45:23 -06:00
..
ast_test.exs Add comprehensive test coverage for SNMPkit modules 2026-02-05 17:03:41 -06:00
compiler_test.exs snmpkit overhaul and etcd 2026-01-23 16:23:57 -06:00
comprehensive_mib_test.exs snmpkit overhaul and etcd 2026-01-23 16:23:57 -06:00
docsis_mib_test.exs snmpkit overhaul and etcd 2026-01-23 16:23:57 -06:00
error_test.exs test: add comprehensive tests for MIB.Error 2026-02-06 08:38:33 -06:00
logger_test.exs test: add comprehensive tests for PDU.Constants and MIB.Logger 2026-02-06 08:36:20 -06:00
parser_test.exs more tests and fixes 2026-01-31 16:00:07 -06:00
preprocessor_test.exs Add comprehensive test coverage for SNMPkit modules 2026-02-05 17:03:41 -06:00
registry_test.exs bring in snmpkit 2026-01-23 12:52:17 -06:00
snmp_tokenizer_test.exs test: add comprehensive tests for MIB.SnmpTokenizer 2026-02-06 08:45:23 -06:00
utilities_test.exs Add comprehensive test coverage for SNMPkit modules 2026-02-05 17:03:41 -06:00