1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Ports of zsh's loadable modules from `Src/Modules/*.c`.
//!
//! Each submodule maps 1:1 to its C-source counterpart. The names
//! match `zsh/<modname>` as exposed by `zmodload`. See each file's
//! header for the specific source-file citation and feature scope.
//!
//! For backwards-compat with the previous flat `crate::<modname>`
//! layout, every entry is re-exported at this module's root so
//! `crate::modules::datetime::...` and `crate::modules::*` both
//! resolve. Top-level call sites should migrate to
//! `crate::modules::<modname>::...` going forward.
pub mod attr;
pub mod cap;
pub mod clone;
pub mod curses;
pub mod datetime;
pub mod db_gdbm;
pub mod example;
pub mod files;
pub mod hlgroup;
pub mod ksh93;
pub mod langinfo;
pub mod mapfile;
pub mod mathfunc;
pub mod nearcolor;
pub mod newuser;
pub mod param_private;
pub mod parameter;
pub mod pcre;
pub mod random;
pub mod random_real;
pub mod regex;
pub mod socket;
pub mod stat;
pub mod system;
pub mod tcp;
pub mod tcp_h;
pub mod termcap;
pub mod terminfo;
pub mod watch;
pub mod zftp;
pub mod zprof;
pub mod zpty;
pub mod zselect;
pub mod zutil;
#[cfg(test)]
mod tests {
/// `Src/Modules/parameter.c::paramtypestr` is consulted by every
/// `${(t)foo}` query and by scanpmparameters' callback emission.
/// The encoding is load-bearing: an integer param must report
/// "integer", a scalar "scalar", etc. — this cross-checks that
/// the dispatch the rest of the parameter introspection relies on
/// is intact.
#[test]
fn paramtypestr_reports_scalar_for_scalar() {
use crate::ported::zsh_h::{hashnode, param, PM_SCALAR};
let pm = param {
node: hashnode { next: None, nam: String::new(), flags: PM_SCALAR as i32 },
u_data: 0, u_arr: None, u_str: Some("v".to_string()),
u_val: 0, u_dval: 0.0, u_hash: None,
gsu_s: None, gsu_i: None, gsu_f: None, gsu_a: None, gsu_h: None,
base: 0, width: 0, env: None, ename: None, old: None, level: 0,
};
let typ = super::parameter::paramtypestr(&pm);
assert_eq!(typ, "scalar");
}
}