MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_option_serialize

Function test_option_serialize

plugins/src/options.rs:853–931  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

851
852 #[test]
853 fn test_option_serialize() {
854 let tests = vec![
855 (
856 ConfigOption::new_str_with_default("name", "default", "description").build(),
857 json!({
858 "name": "name",
859 "description":"description",
860 "default": "default",
861 "type": "string",
862 "dynamic": false,
863 "multi": false,
864 }),
865 ),
866 (
867 ConfigOption::new_i64_with_default("name", 42, "description").build(),
868 json!({
869 "name": "name",
870 "description":"description",
871 "default": 42,
872 "type": "int",
873 "dynamic": false,
874 "multi": false,
875 }),
876 ),
877 (
878 {
879 ConfigOption::new_bool_with_default("name", true, "description")
880 .build()
881 .dynamic()
882 },
883 json!({
884 "name": "name",
885 "description":"description",
886 "default": true,
887 "type": "bool",
888 "dynamic": true,
889 "multi": false,
890 }),
891 ),
892 (
893 ConfigOption::new_flag("name", "description").build(),
894 json!({
895 "name" : "name",
896 "description": "description",
897 "type" : "flag",
898 "default" : false,
899 "dynamic": false,
900 "multi": false,
901 }),
902 ),
903 (
904 ConfigOption::new_str_arr_with_default("name", "Default1", "description").build(),
905 json!({
906 "name" : "name",
907 "description": "description",
908 "type" : "string",
909 "default" : "Default1",
910 "dynamic": false,

Callers

nothing calls this directly

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected