1/* 2 * Copyright (C) 2017 The Libphonenumber Authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto3"; 18 19package i18n.phonenumbers.internal.finitestatematcher.compiler; 20 21option java_package = "com.google.i18n.phonenumbers.internal.finitestatematcher.compiler"; 22option java_outer_classname = "RegressionTestProto"; 23 24// A set of regression tests. 25message Tests { 26 repeated TestCase test_case = 1; 27} 28 29// A single regression test entry. 30message TestCase { 31 // A name for the test, ideally unique. 32 string name = 1; 33 // If set true, expect that the test will fail 100% of the time. This is 34 // useful to test that test numbers have enough coverage to force a failure 35 // and is typically achieved by modifying an input range after generating a 36 // passing test (or carefully modifying the output bytecodes). Note that not 37 // all changes will make a test fail 100% of the time, so care must be taken 38 // to avoid creating a flaky test (e.g. don't change a "[0-3]" to "[0-5]", as 39 // this only fails if the test number contains a 4 or 5 at the corresponding 40 // index, change it to "[4-6]" so there's no overlap and at least one test 41 // number that's valid for that range will not be accepted by the matcher). 42 bool should_fail = 2; 43 // The input ranges (in the form of range specifications) which form the DFA 44 // to be tested (e.g. "1[2-5]678xxxxx" etc...). 45 repeated string range = 3; 46 // The expected output bytes, encoded in test files using C-style hex notation 47 // (i.e. \xHH). This can be split over multiple lines for readability. 48 repeated bytes expected = 4; 49} 50