helper/lib.rs
1// Copyright 2020 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use fuzz::fuzz;
6
7pub fn add_bang(input: String) -> String {
8 let mut result = input;
9 result.push('!');
10 result
11}
12
13pub fn toy_example(input: String) {
14 let mut chars = input.chars();
15 if chars.next() == Some('H') {
16 if chars.next() == Some('I') {
17 if chars.next() == Some('!') {
18 panic!("it works!");
19 }
20 }
21 }
22}
23
24// Compare with `toy_example_same_name` in ../src/lib.rs.
25#[fuzz]
26fn toy_example_same_name(input: String) {
27 toy_example(input)
28}