UI: Zones: Improve IPv4 address regexp.

This commit is contained in:
Nodir Temirkhodjaev 2021-05-28 13:15:53 +03:00
parent 377ac86778
commit 10e3a9d13e
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
#pragma once
#include <QFileInfo>
#include <QSignalSpy>
#include <googletest.h>
@ -83,7 +84,7 @@ TEST_F(NetUtilTest, taskTasix)
tasix.setZoneId(1);
tasix.setSort(true);
tasix.setEmptyNetMask(24);
tasix.setPattern("^\\*\\D{2,5}(\\S+)");
tasix.setPattern("^\\*\\D{2,5}([\\d./-]{7,})");
QString textChecksum;
const auto text = QString::fromLatin1(buf);
@ -97,5 +98,7 @@ TEST_F(NetUtilTest, taskTasix)
tasix.setCachePath(cachePath);
ASSERT_TRUE(tasix.storeAddresses(list));
ASSERT_TRUE(tasix.saveAddressesAsText(cachePath + "tasix-mrlg.txt"));
const QFileInfo out(cachePath + "tasix-mrlg.txt");
ASSERT_TRUE(tasix.saveAddressesAsText(out.filePath()));
ASSERT_GT(out.size(), 0);
}

View File

@ -4,7 +4,7 @@
"title": "Generic",
"description": "Generic list",
"sort": true,
"pattern": "^\\D*(\\S{7,})",
"pattern": "^\\D*([\\d./-]{7,})",
"emptyNetMask": 32
},
{
@ -12,7 +12,7 @@
"title": "BGP",
"description": "BGP table",
"sort": true,
"pattern": "^\\*\\D{2,5}(\\S{7,})",
"pattern": "^\\*\\D{2,5}([\\d./-]{7,})",
"emptyNetMask": 24
}
]