File tree Expand file tree Collapse file tree 2 files changed +410
-0
lines changed
atcoder-problems-backend/atcoder-client Expand file tree Collapse file tree 2 files changed +410
-0
lines changed Original file line number Diff line number Diff line change @@ -89,4 +89,35 @@ mod tests {
89
89
]
90
90
) ;
91
91
}
92
+
93
+ #[ test]
94
+ fn test_scrape_atc002 ( ) {
95
+ let mut file = File :: open ( "test_resources/atc002_tasks" ) . unwrap ( ) ;
96
+ let mut contents = String :: new ( ) ;
97
+ file. read_to_string ( & mut contents) . unwrap ( ) ;
98
+ let problems = scrape ( & contents, "atc002" ) . unwrap ( ) ;
99
+ assert_eq ! (
100
+ problems,
101
+ vec![
102
+ AtCoderProblem {
103
+ id: "abc007_3" . to_owned( ) ,
104
+ contest_id: "atc002" . to_owned( ) ,
105
+ title: "幅優先探索" . to_owned( ) ,
106
+ position: "A" . to_owned( ) ,
107
+ } ,
108
+ AtCoderProblem {
109
+ id: "atc002_b" . to_owned( ) ,
110
+ contest_id: "atc002" . to_owned( ) ,
111
+ title: "n^p mod m" . to_owned( ) ,
112
+ position: "B" . to_owned( ) ,
113
+ } ,
114
+ AtCoderProblem {
115
+ id: "atc002_c" . to_owned( ) ,
116
+ contest_id: "atc002" . to_owned( ) ,
117
+ title: "最適二分探索木" . to_owned( ) ,
118
+ position: "C" . to_owned( ) ,
119
+ } ,
120
+ ]
121
+ )
122
+ }
92
123
}
You can’t perform that action at this time.
0 commit comments