• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / 46f66dd0-bcbd-4904-ad7a-ef4908c2878f

25 Sep 2025 02:50PM UTC coverage: 90.818% (+0.1%) from 90.675%
46f66dd0-bcbd-4904-ad7a-ef4908c2878f

Pull #2927

circleci

Ryan Laddusaw
Update department names and change Theses Central to Thesis Central
Pull Request #2927: Index theses from dspace 7+

1340 of 1449 new or added lines in 16 files covered. (92.48%)

41 existing lines in 7 files now uncovered.

8823 of 9715 relevant lines covered (90.82%)

359.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.36
/lib/bibdata_rs/src/theses/department.rs
1
// This module is responsible for mapping department names in Dataspace to the Library of Congress authorized names
2

3
pub fn map_department(original: &str) -> Option<String> {
36✔
4
    match original {
36✔
5
        "African American Studies" => {
36✔
6
            Some("Princeton University. Department of African American Studies".to_owned())
×
7
        }
8
        "Art and Archaeology" => {
36✔
9
            Some("Princeton University. Department of Art and Archaeology".to_owned())
×
10
        }
11
        "Aeronautical Engineering" => {
36✔
12
            Some("Princeton University. Department of Aeronautical Engineering".to_owned())
×
13
        }
14
        "Anthropology" => Some("Princeton University. Department of Anthropology".to_owned()),
36✔
15
        "Architecture School" => Some("Princeton University. School of Architecture".to_owned()),
36✔
16
        "Astrophysical Sciences" => {
36✔
17
            Some("Princeton University. Department of Astrophysical Sciences".to_owned())
2✔
18
        }
19
        "Biochemical Sciences" => {
34✔
20
            Some("Princeton University. Department of Biochemical Sciences".to_owned())
×
21
        }
22
        "Biology" => Some("Princeton University. Department of Biology".to_owned()),
34✔
23
        "Civil and Environmental Engineering" => Some(
34✔
24
            "Princeton University. Department of Civil and Environmental Engineering".to_owned(),
×
25
        ),
×
26
        "Civil Engineering and Operations Research" => Some(
34✔
27
            "Princeton University. Department of Civil Engineering and Operations Research"
×
28
                .to_owned(),
×
29
        ),
×
30
        "Chemical and Biological Engineering" => Some(
34✔
31
            "Princeton University. Department of Chemical and Biological Engineering".to_owned(),
×
32
        ),
×
33
        "Chemistry" => Some("Princeton University. Department of Chemistry".to_owned()),
34✔
34
        "Classics" => Some("Princeton University. Department of Classics".to_owned()),
34✔
35
        "Comparative Literature" => {
34✔
36
            Some("Princeton University. Department of Comparative Literature".to_owned())
1✔
37
        }
38
        "Computer Science" => {
33✔
39
            Some("Princeton University. Department of Computer Science".to_owned())
×
40
        }
41
        "East Asian Studies" => {
33✔
42
            Some("Princeton University. Department of East Asian Studies".to_owned())
×
43
        }
44
        "Economics" => Some("Princeton University. Department of Economics".to_owned()),
33✔
45
        "Ecology and Evolutionary Biology" => {
33✔
46
            Some("Princeton University. Department of Ecology and Evolutionary Biology".to_owned())
×
47
        }
48
        "Electrical Engineering" => {
33✔
49
            Some("Princeton University. Department of Electrical Engineering".to_owned())
×
50
        }
51
        "Engineering and Applied Science" => {
33✔
52
            Some("Princeton University. School of Engineering and Applied Science".to_owned())
×
53
        }
54
        "English" => Some("Princeton University. Department of English".to_owned()),
33✔
55
        "French and Italian" => {
25✔
56
            Some("Princeton University. Department of French and Italian".to_owned())
×
57
        }
58
        "Geosciences" => Some("Princeton University. Department of Geosciences".to_owned()),
25✔
59
        "German" => Some(
25✔
60
            "Princeton University. Department of Germanic Languages and Literatures".to_owned(),
4✔
61
        ),
4✔
62
        "History" => Some("Princeton University. Department of History".to_owned()),
21✔
63
        "Special Program in Humanities" => {
21✔
64
            Some("Princeton University. Special Program in the Humanities".to_owned())
×
65
        }
66
        "Independent Concentration" => {
21✔
67
            Some("Princeton University Independent Concentration Program".to_owned())
×
68
        }
69
        "Mathematics" => Some("Princeton University. Department of Mathematics".to_owned()),
21✔
70
        "Molecular Biology" => {
21✔
71
            Some("Princeton University. Department of Molecular Biology".to_owned())
×
72
        }
73
        "Mechanical and Aerospace Engineering" => Some(
21✔
74
            "Princeton University. Department of Mechanical and Aerospace Engineering".to_owned(),
×
75
        ),
×
76
        "Medieval Studies" => Some("Princeton University. Program in Medieval Studies".to_owned()),
21✔
77
        "Modern Languages" => {
21✔
78
            Some("Princeton University. Department of Modern Languages.".to_owned())
×
79
        }
80
        "Music" => Some("Princeton University. Department of Music".to_owned()),
21✔
81
        "Near Eastern Studies" => {
21✔
82
            Some("Princeton University. Department of Near Eastern Studies".to_owned())
×
83
        }
84
        "Neuroscience" => Some("Princeton Neuroscience Institute".to_owned()),
21✔
85
        "Operations Research and Financial Engineering" => Some(
21✔
86
            "Princeton University. Department of Operations Research and Financial Engineering"
×
87
                .to_owned(),
×
88
        ),
×
89
        "Oriental Studies" => {
21✔
90
            Some("Princeton University. Department of Oriental Studies".to_owned())
×
91
        }
92
        "Philosophy" => Some("Princeton University. Department of Philosophy".to_owned()),
21✔
93
        "Physics" => Some("Princeton University. Department of Physics".to_owned()),
21✔
94
        "Politics" => Some("Princeton University. Department of Politics".to_owned()),
21✔
95
        "Psychology" => Some("Princeton University. Department of Psychology".to_owned()),
21✔
96
        "Religion" => Some("Princeton University. Department of Religion".to_owned()),
21✔
97
        "Romance Languages and Literatures" => {
21✔
98
            Some("Princeton University. Department of Romance Languages and Literatures".to_owned())
×
99
        }
100
        "Slavic Languages and Literature" => {
21✔
101
            Some("Princeton University. Department of Slavic Languages and Literatures".to_owned())
×
102
        }
103
        "Sociology" => Some("Princeton University. Department of Sociology".to_owned()),
21✔
104
        "Spanish and Portuguese" => Some(
21✔
105
            "Princeton University. Department of Spanish and Portuguese Languages and Cultures"
×
106
                .to_owned(),
×
107
        ),
×
108
        "Spanish and Portuguese Languages and Cultures" => Some(
21✔
109
            "Princeton University. Department of Spanish and Portuguese Languages and Cultures"
×
110
                .to_owned(),
×
111
        ),
×
112
        "Statistics" => Some("Princeton University. Department of Statistics".to_owned()),
21✔
113
        "School of Public and International Affairs" => {
21✔
NEW
114
            Some("Princeton University. School of Public and International Affairs".to_owned())
×
115
        },
116

117
        "Public & International Affairs" => Some("Princeton University. School of Public and International Affairs".to_owned()),
21✔
118
        "Art & Archaeology" => Some("Princeton University. Department of Art and Archaeology".to_owned()),
21✔
119
        "Civil & Environmental Engr" => Some("Princeton University. Department of Civil and Environmental Engineering".to_owned()),
21✔
120
        "Mechanical & Aerospace Engr" => Some("Princeton University. Department of Mechanical and Aerospace Engineering".to_owned()),
21✔
121
        "Chemical and Biological Engr" => Some("Princeton University. Department of Chemical and Biological Engineering".to_owned()),
21✔
122
        "Architecture" => Some("Princeton University. School of Architecture".to_owned()),
21✔
123
        "Ops Research & Financial Engr" => Some("Princeton University. Department of Operations Research and Financial Engineering".to_owned()),
21✔
124
        "Electrical & Computer Engr" => Some("Princeton University. Department of Electrical Engineering".to_owned()),
21✔
125
        "Creative Writing Program" => Some("Princeton University. Creative Writing Program".to_owned()),
21✔
126
        "Ecology & Evolutionary Biology" => Some("Princeton University. Department of Ecology and Evolutionary Biology".to_owned()),
21✔
127
        "Independent Study-Linguistics" => Some("Princeton University Independent Concentration Program".to_owned()),
21✔
128
        _ => None,
21✔
129
    }
130
}
36✔
131

132
#[cfg(test)]
133
mod tests {
134
    use super::*;
135
    #[test]
136
    fn it_maps_department_to_lc_department() {
1✔
137
        assert_eq!(
1✔
138
            map_department("Comparative Literature").unwrap(),
1✔
139
            "Princeton University. Department of Comparative Literature"
140
        );
141
        assert_eq!(map_department("Cool new department"), None);
1✔
142
    }
1✔
143
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc