feat: Initialize project with core dependencies, Vultr API client, customer database service, and migration documentation.
This commit is contained in:
27
not_used/test_pattern_match.js
Normal file
27
not_used/test_pattern_match.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const mikrotik = require('./services/mikrotikService');
|
||||
|
||||
// Mock getInterfaces to return the user's specific pattern
|
||||
mikrotik.getInterfaces = async () => {
|
||||
return [
|
||||
{ name: '<pppoe-221128130266>', type: 'pppoe-in' },
|
||||
{ name: 'ether1', type: 'ether' },
|
||||
{ name: 'vlan_88_PtP_Dell', type: 'vlan' }
|
||||
];
|
||||
};
|
||||
|
||||
async function test() {
|
||||
console.log("Testing Pattern Matching...");
|
||||
|
||||
const inputs = ['221128130266', '<pppoe-221128130266>'];
|
||||
|
||||
for (const input of inputs) {
|
||||
const found = await mikrotik.findInterface(input);
|
||||
if (found) {
|
||||
console.log(`MATCH: '${input}' -> '${found.name}'`);
|
||||
} else {
|
||||
console.log(`NO MATCH: '${input}'`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
Reference in New Issue
Block a user