1// Copyright 2024 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.
45use version_history::*;
67const VERSIONS: &[Version] = &version_history_macro::declare_version_history!();
89/// Global [VersionHistory] instance generated at build-time from the contents
10/// of `//sdk/version_history.json`.
11pub const HISTORY: VersionHistory = VersionHistory::new(VERSIONS);
1213#[cfg(test)]
14mod tests {
15use super::*;
1617#[test]
18fn test_version_history_works() {
19assert_eq!(
20 VERSIONS[0],
21 Version {
22 api_level: 4.into(),
23 abi_revision: 0x601665C5B1A89C7F.into(),
24 status: Status::Unsupported,
25 }
26 )
27 }
2829#[test]
30fn test_example_supported_abi_revision_is_supported() {
31let example_version = HISTORY.get_example_supported_version_for_tests();
3233assert_eq!(
34 HISTORY.check_api_level_for_build(example_version.api_level),
35Ok(example_version.abi_revision)
36 );
3738 HISTORY
39 .check_abi_revision_for_runtime(example_version.abi_revision)
40 .expect("you said it was supported!");
41 }
42}