View | Details | Raw Unified | Return to bug 33277
Collapse All | Expand All

(-)a/C4/Heading/MARC21.pm (-1 / +1 lines)
Lines 339-345 sub parse_heading { Link Here
339
    my $thesaurus =
339
    my $thesaurus =
340
      $tag =~ m/6../
340
      $tag =~ m/6../
341
      ? _get_subject_thesaurus($field)
341
      ? _get_subject_thesaurus($field)
342
      : "lcsh";    # use 'lcsh' for names, UT, etc.
342
      : undef;    # We can't know the thesaurus for non-subject fields
343
    my $search_heading =
343
    my $search_heading =
344
      _get_search_heading( $field, $field_info->{'subfields'} );
344
      _get_search_heading( $field, $field_info->{'subfields'} );
345
    my $display_heading =
345
    my $display_heading =
(-)a/t/db_dependent/Heading.t (-3 lines)
Lines 114-120 subtest "_search tests" => sub { Link Here
114
    $terms = $search_query->{query}->{bool}->{must};
114
    $terms = $search_query->{query}->{bool}->{must};
115
    $expected_terms = [
115
    $expected_terms = [
116
        { term => { 'match-heading.ci_raw' => 'Yankovic, Al 1959' } },
116
        { term => { 'match-heading.ci_raw' => 'Yankovic, Al 1959' } },
117
        { term => { 'subject-heading-thesaurus.ci_raw' => 'a' } },
118
    ];
117
    ];
119
    is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with single punctuation mark");
118
    is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with single punctuation mark");
120
119
Lines 124-130 subtest "_search tests" => sub { Link Here
124
    $terms = $search_query->{query}->{bool}->{must};
123
    $terms = $search_query->{query}->{bool}->{must};
125
    $expected_terms = [
124
    $expected_terms = [
126
        { term => { 'match-heading.ci_raw' => 'Yankovic, Al 1959' } },
125
        { term => { 'match-heading.ci_raw' => 'Yankovic, Al 1959' } },
127
        { term => { 'subject-heading-thesaurus.ci_raw' => 'a' } },
128
    ];
126
    ];
129
    is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with double punctuation, hyphen+comma");
127
    is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with double punctuation, hyphen+comma");
130
128
Lines 134-140 subtest "_search tests" => sub { Link Here
134
    $terms = $search_query->{query}->{bool}->{must};
132
    $terms = $search_query->{query}->{bool}->{must};
135
    $expected_terms = [
133
    $expected_terms = [
136
        { term => { 'match-heading.ci_raw' => 'Tolkien, J.R.R' } },
134
        { term => { 'match-heading.ci_raw' => 'Tolkien, J.R.R' } },
137
        { term => { 'subject-heading-thesaurus.ci_raw' => 'a' } },
138
    ];
135
    ];
139
    is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with double punctuation, period+comma ");
136
    is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with double punctuation, period+comma ");
140
137
(-)a/t/db_dependent/Heading_MARC21.t (-3 / +2 lines)
Lines 25-36 SKIP: { Link Here
25
    $heading = C4::Heading->new_from_field($field);
25
    $heading = C4::Heading->new_from_field($field);
26
    is($heading->display_form(), 'The dark is rising ;', 'Display form generation');
26
    is($heading->display_form(), 'The dark is rising ;', 'Display form generation');
27
    is($heading->search_form(), 'The dark is rising', 'Search form generation');
27
    is($heading->search_form(), 'The dark is rising', 'Search form generation');
28
    is($heading->{thesaurus}, 'lcsh', 'Thesaurus generation');
28
    ok( !defined $heading->{thesaurus}, 'Thesaurus is not generated outside of 6XX fields');
29
29
30
    $field = MARC::Field->new( '100', '1', '', a => 'Yankovic, Al', d => '1959-' );
30
    $field = MARC::Field->new( '100', '1', '', a => 'Yankovic, Al', d => '1959-' );
31
    $heading = C4::Heading->new_from_field($field);
31
    $heading = C4::Heading->new_from_field($field);
32
    is($heading->display_form(), 'Yankovic, Al 1959-', 'Display form generation');
32
    is($heading->display_form(), 'Yankovic, Al 1959-', 'Display form generation');
33
    is($heading->search_form(), 'Yankovic, Al 1959', 'Search form generation');
33
    is($heading->search_form(), 'Yankovic, Al 1959', 'Search form generation');
34
    is($heading->{thesaurus}, 'lcsh', 'Thesaurus generation');
34
    ok( !defined $heading->{thesaurus}, 'Thesaurus is not generated outside of 6XX fields');
35
35
36
}
36
}
37
- 

Return to bug 33277