From 1f599709d0d98b214cd44ae5efce96d429e2c1fc Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Mon, 30 Mar 2015 21:42:10 -0400 Subject: [PATCH] corrected erroneous return type in test hash table. made search_text skip binary files in first grep, which is a lot nicer and faster. --- nucleus/library/tests_structures/test_hash_table.cpp | 4 +++- scripts/text/search_text.sh | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/nucleus/library/tests_structures/test_hash_table.cpp b/nucleus/library/tests_structures/test_hash_table.cpp index 0fc446c2..ca0d465f 100644 --- a/nucleus/library/tests_structures/test_hash_table.cpp +++ b/nucleus/library/tests_structures/test_hash_table.cpp @@ -247,7 +247,8 @@ bool test_hash_table::test_add() to_add->snacky_string = string_manipulation::make_random_name(); to_add->food_bar = random_id; outcome expected = common::IS_NEW; - if (_keys_in_use.member(random_id)) return common::EXISTING; + // make sure it doesn't exist already. + if (_keys_in_use.member(random_id)) return false; ASSERT_EQUAL(_the_table.add(random_id, to_add).value(), expected.value(), "add should give proper outcome based on expectation"); if (_keys_in_use.member(random_id)) @@ -520,3 +521,4 @@ return false; HOOPLE_MAIN(test_hash_table, ) + diff --git a/scripts/text/search_text.sh b/scripts/text/search_text.sh index 48905405..c0abee90 100644 --- a/scripts/text/search_text.sh +++ b/scripts/text/search_text.sh @@ -50,6 +50,11 @@ find "$dir" -type f \( -iname "*" \ ! -iname "*.xls" \ ! -iname "*.xlsx" \ ! -iname "*.zip" \) \ - -exec echo "\"{}\"" ';' | xargs grep -li -- "$seek" | grep -v "^\.[^\/]\|\/\." + -exec echo "\"{}\"" ';' | xargs grep -li --binary-files=without-match -- "$seek" | grep -v "^\.[^\/]\|\/\." + +# first grep looks in every valid file for the pattern requested. +# second grep strains out dot files. +#hmmm: why are we doing that second step? + -- 2.34.1