Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
5291e482
Kaydet (Commit)
5291e482
authored
Nis 24, 2016
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unit test for tdf#99468
Change-Id: I833ad2779d0eda6f5183b2dd062dffaa410a7937
üst
ffbe1b43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
test_textsearch.cxx
i18npool/qa/cppunit/test_textsearch.cxx
+23
-0
No files found.
i18npool/qa/cppunit/test_textsearch.cxx
Dosyayı görüntüle @
5291e482
...
...
@@ -251,6 +251,29 @@ void TestTextSearch::testWildcardSearch()
aRes
=
m_xSearch2
->
searchBackward
(
aText
,
aText
.
getLength
(),
0
);
CPPUNIT_ASSERT
(
aRes
.
subRegExpressions
==
1
);
CPPUNIT_ASSERT
((
aRes
.
startOffset
[
0
]
==
5
)
&&
(
aRes
.
endOffset
[
0
]
==
0
));
aText
=
"123123"
;
aOptions
.
searchString
=
"*2?"
;
m_xSearch2
->
setOptions2
(
aOptions
);
// match first "123", [0,3)
aRes
=
m_xSearch2
->
searchForward
(
aText
,
0
,
aText
.
getLength
());
CPPUNIT_ASSERT
(
aRes
.
subRegExpressions
==
1
);
CPPUNIT_ASSERT
((
aRes
.
startOffset
[
0
]
==
0
)
&&
(
aRes
.
endOffset
[
0
]
==
3
));
// match "123123", (6,0] Yes this looks odd, but it is as searching "?2*" forward.
aRes
=
m_xSearch2
->
searchBackward
(
aText
,
aText
.
getLength
(),
0
);
CPPUNIT_ASSERT
(
aRes
.
subRegExpressions
==
1
);
CPPUNIT_ASSERT
((
aRes
.
startOffset
[
0
]
==
6
)
&&
(
aRes
.
endOffset
[
0
]
==
0
));
aOptions
.
searchFlag
|=
util
::
SearchFlags
::
WILD_MATCH_SELECTION
;
m_xSearch2
->
setOptions2
(
aOptions
);
// match "123123", [0,6) with greedy '*'
aRes
=
m_xSearch2
->
searchForward
(
aText
,
0
,
aText
.
getLength
());
CPPUNIT_ASSERT
(
aRes
.
subRegExpressions
==
1
);
CPPUNIT_ASSERT
((
aRes
.
startOffset
[
0
]
==
0
)
&&
(
aRes
.
endOffset
[
0
]
==
6
));
// match "123123", (6,0]
aRes
=
m_xSearch2
->
searchBackward
(
aText
,
aText
.
getLength
(),
0
);
CPPUNIT_ASSERT
(
aRes
.
subRegExpressions
==
1
);
CPPUNIT_ASSERT
((
aRes
.
startOffset
[
0
]
==
6
)
&&
(
aRes
.
endOffset
[
0
]
==
0
));
}
void
TestTextSearch
::
setUp
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment