Use int type name consistently (#10579)

# Description
When referring to the type use `int` consistently. Only when referring
to the concept of integer numbers use `integer`.

- Fix `random integer` to `random int` tests
  - Forgot in #10520
- Use int instead of integer in error messages
- Use int type name in bits commands
- Fix messages in `for` examples
- Use int typename in `into` commands
- Use int typename in rest of commands
- Report errors in `nu-protocol` with int typename

Work for #10332 

# User-Facing Changes
User errorrs should now use `int` so you can easily find the necessary
commands or type annotations.

# Tests + Formatting
Only two tests found that needed updating
This commit is contained in:
Stefan Holderbach
2023-10-03 18:24:32 +02:00
committed by GitHub
parent 2cc4191ec9
commit 7c1487e18d
36 changed files with 77 additions and 93 deletions

View File

@ -2,21 +2,21 @@ use nu_test_support::nu;
#[test]
fn generates_an_integer() {
let actual = nu!("random integer 42..43");
let actual = nu!("random int 42..43");
assert!(actual.out.contains("42") || actual.out.contains("43"));
}
#[test]
fn generates_55() {
let actual = nu!("random integer 55..55");
let actual = nu!("random int 55..55");
assert!(actual.out.contains("55"));
}
#[test]
fn generates_0() {
let actual = nu!("random integer ..<1");
let actual = nu!("random int ..<1");
assert!(actual.out.contains('0'));
}

View File

@ -2,6 +2,6 @@ mod bool;
mod chars;
mod dice;
mod float;
mod integer;
mod int;
#[cfg(feature = "uuid_crate")]
mod uuid;

View File

@ -245,7 +245,7 @@ fn url_join_with_invalid_port() {
assert!(actual
.err
.contains("Port parameter should represent an unsigned integer"));
.contains("Port parameter should represent an unsigned int"));
let actual = nu!(pipeline(
r#"
@ -259,7 +259,7 @@ fn url_join_with_invalid_port() {
assert!(actual
.err
.contains("Port parameter should be an unsigned integer or a string representing it"));
.contains("Port parameter should be an unsigned int or a string representing it"));
}
#[test]