From a2392a4a87fa0366cbff131d3fd421f83f52492f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dobros=C5=82aw=20=C5=BBybort?= Date: Mon, 22 Dec 2014 15:03:27 +0100 Subject: [PATCH] fix: benchmarks: proper string for smart truncate --- slug_test.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/slug_test.go b/slug_test.go index 404e524..b996c36 100644 --- a/slug_test.go +++ b/slug_test.go @@ -301,7 +301,7 @@ func BenchmarkSubstituteRuneLong(b *testing.B) { } func BenchmarkSmartTruncateShort(b *testing.B) { - shortStr := "Hello world" + shortStr := "Hello-world" MaxLength = 8 b.ReportAllocs() @@ -312,21 +312,21 @@ func BenchmarkSmartTruncateShort(b *testing.B) { } func BenchmarkSmartTruncateLong(b *testing.B) { - longStr := "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi " + - "pulvinar sodales ultrices. Nulla facilisi. Sed at vestibulum erat. Ut " + - "sit amet urna posuere, sagittis eros ac, varius nisi. Morbi ullamcorper " + - "odio at nunc pulvinar mattis. Vestibulum rutrum, ante eu dictum mattis, " + - "elit risus finibus nunc, consectetur facilisis eros leo ut sapien. Sed " + - "pulvinar volutpat mi. Cras semper mi ac eros accumsan, at feugiat massa " + - "elementum. Morbi eget dolor sit amet purus condimentum egestas non ut " + - "sapien. Duis feugiat magna vitae nisi lobortis, quis finibus sem " + - "sollicitudin. Pellentesque eleifend blandit ipsum, ut porta arcu " + - "ultricies et. Fusce vel ipsum porta, placerat diam ac, consectetur " + - "magna. Nulla in porta sem. Suspendisse commodo, felis in molestie " + - "ultricies, arcu ipsum aliquet turpis, elementum dapibus ipsum lorem a " + - "nisl. Etiam varius imperdiet placerat. Aliquam euismod lacus arcu, " + - "ultrices hendrerit est pellentesque vel. Aliquam sit amet laoreet leo. " + - "Integer eros libero, mollis sed posuere." + longStr := "Lorem-ipsum-dolor-sit-amet,-consectetur-adipiscing-elit.-Morbi-" + + "pulvinar-sodales-ultrices.-Nulla-facilisi.-Sed-at-vestibulum-erat.-Ut-" + + "sit-amet-urna-posuere,-sagittis-eros-ac,-varius-nisi.-Morbi-ullamcorper-" + + "odio-at-nunc-pulvinar-mattis.-Vestibulum-rutrum,-ante-eu-dictum-mattis,-" + + "elit-risus-finibus-nunc,-consectetur-facilisis-eros-leo-ut-sapien.-Sed-" + + "pulvinar-volutpat-mi.-Cras-semper-mi-ac-eros-accumsan,-at-feugiat-massa-" + + "elementum.-Morbi-eget-dolor-sit-amet-purus-condimentum-egestas-non-ut-" + + "sapien.-Duis-feugiat-magna-vitae-nisi-lobortis,-quis-finibus-sem-" + + "sollicitudin.-Pellentesque-eleifend-blandit-ipsum,-ut-porta-arcu-" + + "ultricies-et.-Fusce-vel-ipsum-porta,-placerat-diam-ac,-consectetur-" + + "magna.-Nulla-in-porta-sem.-Suspendisse-commodo,-felis-in-molestie-" + + "ultricies,-arcu-ipsum-aliquet-turpis,-elementum-dapibus-ipsum-lorem-a-" + + "nisl.-Etiam-varius-imperdiet-placerat.-Aliquam-euismod-lacus-arcu,-" + + "ultrices-hendrerit-est-pellentesque-vel.-Aliquam-sit-amet-laoreet-leo.-" + + "Integer-eros-libero,-mollis-sed-posuere." MaxLength = 256 b.ReportAllocs()