-
Notifications
You must be signed in to change notification settings - Fork 9
Update cache to ignore values over 250 characters (D1118) #596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cf79966
Update cache to ignore values over 250 characters
droberts-ctrlo 7282827
Fix cache code
droberts-ctrlo ecff432
Fix test for caching and added search test
droberts-ctrlo 86cf162
Update test to check for value removal
droberts-ctrlo bd07f41
Added comment to test and removed debug code
droberts-ctrlo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| use Test::More; # tests => 1; | ||
| use strict; | ||
| use warnings; | ||
|
|
||
| use Log::Report; | ||
| use GADS::Layout; | ||
| use GADS::Record; | ||
| use GADS::Records; | ||
| use GADS::Schema; | ||
| use GADS::Filter; | ||
| use GADS::View; | ||
|
|
||
| use lib 't/lib'; | ||
| use Test::GADS::DataSheet; | ||
|
|
||
| my $long_string = "Y3EucBXt2aTYnHNb2hXJTrgAg0QqRieA1kxNo1ud2TbcyxrXMXqu" | ||
| . "/m83YtthBWYXiEdocydX69XqB/6IK+6NqGDZJgofxgjVxGJmP1HONBT651Yj/" | ||
| . "47mRf4+coC3gqvzh6vQ1nCeZyWeVKVuoiiG5INOuwanGJESPDgJrvichI00Czskjah5Ju6/" | ||
| . "tHOez+6p3hciNXUYuq76g6KFkTn4tbWegJd2Hh/bNVYqTX5yDW0MIQQQSoe2i+NLA5xi"; | ||
|
|
||
| my $data = [ | ||
| { | ||
| string1 => [$long_string], | ||
| }, | ||
| { | ||
| string1 => ['The quick brown fox jumps over the lazy dog.'], | ||
| } | ||
| ]; | ||
|
|
||
| my $sheet = Test::GADS::DataSheet->new( | ||
| data => $data, | ||
| multivalue => 0, | ||
| calc_code => " | ||
| function evaluate (L1string1) | ||
| return L1string1 | ||
| end | ||
| ", | ||
| calc_return_type => 'string', | ||
| ); | ||
| $sheet->create_records; | ||
|
|
||
| my $schema = $sheet->schema; | ||
| my $layout = $sheet->layout; | ||
| my $columns = $sheet->columns; | ||
| my $user = $sheet->user_normal1; | ||
|
|
||
| my $string1 = $columns->{string1}; | ||
| my $calc1 = $columns->{calc1}; | ||
|
|
||
| my $record = GADS::Record->new( | ||
| layout => $layout, | ||
| schema => $schema, | ||
| instance_id => 1, | ||
| user => $user, | ||
| ); | ||
|
|
||
| $record->find_current_id(1); | ||
|
|
||
| my $filter = GADS::Filter->new( | ||
| as_hash => { | ||
| rules => [ | ||
| { | ||
| id => $calc1->id, | ||
| type => 'string', | ||
| value => $long_string, | ||
| operator => 'equal', | ||
| } | ||
| ], | ||
| }, | ||
| ); | ||
|
|
||
| my $view = GADS::View->new( | ||
| name => 'View table', | ||
| filter => $filter, | ||
| instance_id => 1, | ||
| layout => $layout, | ||
| schema => $schema, | ||
| is_shared => 1, | ||
| ); | ||
|
|
||
| $view->write( no_errors => 1 ); | ||
|
|
||
| my $records = GADS::Records->new( | ||
| user => $user, | ||
| layout => $layout, | ||
| schema => $schema, | ||
| view => $view | ||
| ); | ||
|
|
||
| is $records->count, 1, "One record found with long string in calc field"; | ||
|
|
||
| $filter->as_hash->{rules}[0]{value} = "brown"; | ||
| $filter->as_hash->{rules}[0]{operator} = "contains"; | ||
|
|
||
| my $view2 = GADS::View->new( | ||
| name => 'View table 2', | ||
| filter => $filter, | ||
| instance_id => 1, | ||
| layout => $layout, | ||
| schema => $schema, | ||
| is_shared => 1, | ||
| ); | ||
|
|
||
| $view2->write( no_errors => 1 ); | ||
|
|
||
| $records->clear; | ||
|
|
||
| $records->view($view2); | ||
|
|
||
| is $records->count, 1, "One record found with the word `brown` in the string field"; | ||
|
|
||
| $records->clear; | ||
|
|
||
| $records->view(undef); | ||
|
|
||
| is $records->count, 2, "No filter, two records found"; | ||
|
|
||
| $records->clear; | ||
|
|
||
| $filter->as_hash->{rules}[0]{value} = "non-existing string"; | ||
| $filter->as_hash->{rules}[0]{operator} = "equal"; | ||
|
|
||
| my $view3 = GADS::View->new( | ||
| name => 'View table 3', | ||
| filter => $filter, | ||
| instance_id => 1, | ||
| layout => $layout, | ||
| schema => $schema, | ||
| is_shared => 1, | ||
| ); | ||
|
|
||
| $records->view($view); | ||
|
|
||
| is $records->count, 0, "No records found with non-existing string"; | ||
|
|
||
| done_testing; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.