repo
stringlengths
8
35
pull_number
int64
25
15.2k
instance_id
stringlengths
13
40
issue_numbers
listlengths
1
3
base_commit
stringlengths
40
40
patch
stringlengths
274
342k
test_patch
stringlengths
308
210k
problem_statement
stringlengths
25
44.3k
hints_text
stringlengths
0
33.6k
created_at
stringlengths
19
20
version
stringlengths
3
5
environment_setup_commit
stringlengths
40
40
FAIL_TO_PASS
listlengths
1
1.1k
PASS_TO_PASS
listlengths
0
7.38k
FAIL_TO_FAIL
listlengths
0
1.72k
PASS_TO_FAIL
listlengths
0
49
__index_level_0__
int64
0
689
updated_at
stringdate
2016-10-29 01:18:22
2025-03-06 19:15:37
sigoden/aichat
1,056
sigoden__aichat-1056
[ "1055" ]
737580bb87f3b1d2f040dd7a4ddacca3595915a0
diff --git a/src/cli.rs b/src/cli.rs --- a/src/cli.rs +++ b/src/cli.rs @@ -73,12 +73,7 @@ pub struct Cli { impl Cli { pub fn text(&self) -> Option<String> { - let text = self - .text - .iter() - .map(|x| x.trim().to_string()) - .collect::<Vec<String>>() - ...
diff --git a/src/repl/mod.rs b/src/repl/mod.rs --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -807,6 +811,10 @@ mod tests { split_files_text("file.txt -- hello", false), (vec!["file.txt".into()], "hello") ); + assert_eq!( + split_files_text("file.txt -- \thello", fal...
Unable to define a grammar check that keeps indentation. **Describe the bug** When passing a string via argument, or STDIN, whitespace is trimmed in my role. **To Reproduce** I edited the grammar role example, and tried to make it work with code comments and indentation (I pipe strings from my editor to aichat...
2024-12-14T06:50:17
0.25
737580bb87f3b1d2f040dd7a4ddacca3595915a0
[ "repl::tests::test_split_files_text" ]
[ "config::role::tests::test_merge_prompt_name", "config::role::tests::test_parse_structure_prompt1", "config::role::tests::test_parse_structure_prompt2", "config::role::tests::test_parse_structure_prompt3", "config::role::tests::test_match_name", "client::stream::tests::test_json_stream_ndjson", "rag::sp...
[]
[]
0
2024-12-13T23:00:49Z
alacritty/alacritty
8,356
alacritty__alacritty-8356
[ "8314", "8268" ]
22a447573bbd67c0a5d3946d58d6d61bac3b4ad2
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Notable changes to the `alacritty_terminal` crate are documented in its [CHANGELOG](./alacritty_terminal/CHANGELOG.md). +## 0.14.1-rc1 + +#...
diff --git a/alacritty/src/input/mod.rs b/alacritty/src/input/mod.rs --- a/alacritty/src/input/mod.rs +++ b/alacritty/src/input/mod.rs @@ -1136,7 +1136,7 @@ mod tests { inline_search_state: &'a mut InlineSearchState, } - impl<'a, T: EventListener> super::ActionContext<T> for ActionContext<'a, T> { + ...
Semantic characters in Vi Mode and moving left ### System OS: Linux 6.11.9 (arch) Version: alacritty 0.14.0 (22a44757) Sway 1:1.10-1 ``` [0.000000942s] [INFO ] [alacritty] Welcome to Alacritty [0.000051958s] [INFO ] [alacritty] Version 0.14.0 (22a44757) [0.000061095s] [INFO ] [alacritty] Running on Wayland...
2024-12-14T09:10:33
0.14
22a447573bbd67c0a5d3946d58d6d61bac3b4ad2
[ "vi_mode::tests::wide_semantic_char" ]
[ "grid::storage::tests::indexing", "grid::storage::tests::rotate", "grid::storage::tests::shrink_before_and_after_zero", "grid::storage::tests::rotate_wrap_zero", "grid::storage::tests::indexing_above_inner_len - should panic", "grid::storage::tests::shrink_after_zero", "grid::storage::tests::shrink_befo...
[]
[]
1
2024-12-22T23:22:35Z
alacritty/alacritty
8,315
alacritty__alacritty-8315
[ "8314" ]
4f739a7e2b933f6828ebf64654c8a8c573bf0ec1
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its - Mouse/Vi cursor hint highlighting broken on the terminal cursor line - Hint launcher opening arbitrary text, when terminal content changed while ...
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -930,6 +930,11 @@ impl<T> Term<T> { &self.config.semantic_escape_chars } + #[cfg(test)] + pub(crate) fn set_semantic_escape_char...
Semantic characters in Vi Mode and moving left ### System OS: Linux 6.11.9 (arch) Version: alacritty 0.14.0 (22a44757) Sway 1:1.10-1 ``` [0.000000942s] [INFO ] [alacritty] Welcome to Alacritty [0.000051958s] [INFO ] [alacritty] Version 0.14.0 (22a44757) [0.000061095s] [INFO ] [alacritty] Running on Wayland...
I'd assume that you have those wide chars in semantic chars specified, since wide chars are not there by default. Yes. `[selection] semantic_escape_chars = ",│`|:\"' ()[]{}<>\t•-—-." ` It seems like `b` isn't the only binding affected. The `w` binding also does not work correctly.
2024-11-20T09:21:31
1.74
4f739a7e2b933f6828ebf64654c8a8c573bf0ec1
[ "vi_mode::tests::wide_semantic_char" ]
[ "grid::storage::tests::indexing", "grid::storage::tests::rotate", "grid::storage::tests::indexing_above_inner_len - should panic", "grid::storage::tests::rotate_wrap_zero", "grid::storage::tests::shrink_after_zero", "grid::storage::tests::shrink_before_and_after_zero", "grid::storage::tests::shrink_befo...
[]
[]
2
2024-11-22T01:07:12Z
alacritty/alacritty
8,069
alacritty__alacritty-8069
[ "8060" ]
5e6b92db85b3ea7ffd06a7a5ae0d2d62ad5946a6
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its - Leaking FDs when closing windows on Unix systems - Config emitting errors for nonexistent import paths - Kitty keyboard protocol reporting shifted...
diff --git a/alacritty_terminal/src/term/search.rs b/alacritty_terminal/src/term/search.rs --- a/alacritty_terminal/src/term/search.rs +++ b/alacritty_terminal/src/term/search.rs @@ -1155,4 +1155,20 @@ mod tests { assert_eq!(start, Point::new(Line(1), Column(0))); assert_eq!(end, Point::new(Line(1), C...
Bug: backward search on single line goes in cycles When using backward search, it sometimes goes in cycles without moving a cursor to some search result. In example video, before resizing, everything works fine, but after resizing, it cycles only on several last elements on the line, instead of cycling through all occu...
The provided video cannot be played back. @chrisduerr , I can play it back. Do you use firefox? If so, videos in github with firefox is a known bug. Try downloading video or using another browser :shrug: Even without video, try to create a long line with like 30 or 40 entries of the same word and try backward-searchin...
2024-06-29T07:36:44
1.70
5e6b92db85b3ea7ffd06a7a5ae0d2d62ad5946a6
[ "term::search::tests::inline_word_search" ]
[ "grid::storage::tests::indexing", "grid::storage::tests::indexing_above_inner_len - should panic", "grid::storage::tests::rotate", "grid::storage::tests::rotate_wrap_zero", "grid::storage::tests::shrink_after_zero", "grid::storage::tests::shrink_before_and_after_zero", "grid::storage::tests::shrink_then...
[]
[]
3
2024-07-05T13:08:08Z
alacritty/alacritty
7,729
alacritty__alacritty-7729
[ "7720" ]
c354f58f421c267cc1472414eaaa9f738509ede0
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Autokey no longer working with alacritty on X11 - Freeze when moving window between monitors on Xfwm - Mouse cursor not changing on Wayla...
diff --git a/alacritty_config_derive/tests/config.rs b/alacritty_config_derive/tests/config.rs --- a/alacritty_config_derive/tests/config.rs +++ b/alacritty_config_derive/tests/config.rs @@ -23,7 +23,7 @@ impl Default for TestEnum { #[derive(ConfigDeserialize)] struct Test { - #[config(alias = "noalias")] + #...
CLI -o config overrides should accept aliases as documented ### Expected behavior As indicated by `man alacritty`, the `-o` option can be used to override configuration from the `alacritty.toml` config file with the properties specified by `man 5 alacritty`. One would therefore expect that ```alacritty -o 'colors.cur...
The problem is [here](https://github.com/alacritty/alacritty/blob/master/alacritty_config_derive/src/serde_replace.rs#L51). This is what's generated when I look with `cargo expand`: ```rust #[allow(clippy::extra_unused_lifetimes)] impl<'de> alacritty_config::SerdeReplace for InvertedCellColors { fn...
2024-02-14T03:46:11
1.72
41d2f1df4509148a6f1ffb3de59c2389a3a93283
[ "replace_derive_using_alias", "replace_derive_using_multiple_aliases", "replace_flatten_using_alias" ]
[ "replace_derive", "field_replacement", "replace_flatten", "config_deserialize" ]
[]
[]
4
2024-03-01T07:46:10Z
alacritty/alacritty
7,204
alacritty__alacritty-7204
[ "7097" ]
77aa9f42bac4377efe26512d71098d21b9b547fd
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Cut off wide characters in preedit string - Scrolling on touchscreens - Double clicking on CSD titlebar not always maximizing a window on...
diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs --- a/alacritty/src/config/ui_config.rs +++ b/alacritty/src/config/ui_config.rs @@ -578,8 +578,8 @@ mod tests { "ftp://ftp.example.org", ] { let term = mock_term(regular_url); - let regex = R...
Hint regex with large chars amount. Hanging and continues memory consumption ### Problem With the `Qm[0-9A-Za-z]{44}` as a hint regex pattern, Alacritty hangs upon activating Hints and memory consumption starts to growth continuously. ```yml # ... rest of the config hints: enabled: - regex: 'Qm[0-9A-Za...
Going to remove high priority from this since it shouldn't cause complete destruction anymore. But I still think we can probably do better. Potentially a lazily evaluated regex might perform more reasonably.
2023-09-09T05:15:52
1.65
77aa9f42bac4377efe26512d71098d21b9b547fd
[ "term::search::tests::runtime_cache_error" ]
[ "grid::storage::tests::indexing", "grid::storage::tests::rotate_wrap_zero", "grid::storage::tests::rotate", "grid::storage::tests::shrink_after_zero", "grid::storage::tests::indexing_above_inner_len - should panic", "grid::storage::tests::shrink_before_and_after_zero", "grid::storage::tests::shrink_befo...
[]
[]
5
2023-09-17T11:59:29Z
alacritty/alacritty
5,870
alacritty__alacritty-5870
[ "5840" ]
8a26dee0a9167777709935789b95758e36885617
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,27 @@ The sections should follow the order `Packaging`, `Added`, `Changed`, `Fixed` an The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## 0.10.1-rc1 + +### Added + + - Option `font.builtin_bo...
diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -33,7 +33,7 @@ tasks: cargo clippy --all-targets - feature-wayland: | cd alacritty/alacritty - cargo test --no-default-features --features=wayland + RUSTFLAGS="-D warnings" cargo test...
Alacritty keeps asking for permissions ### System OS: MacOS 12.0.1 Version: 0.10.0 ### Expected Behavior Alacritty asks for permissions to access folders once and remembers. ### Actual Behavior Every keystroke in a protected MacOS folder (i.e. Desktop, Downloads, Documents) I get a prompt to give it access....
2022-02-10T01:07:06
0.10
8a26dee0a9167777709935789b95758e36885617
[ "ansi::tests::parse_osc104_reset_all_colors" ]
[ "ansi::tests::parse_control_attribute", "ansi::tests::parse_designate_g0_as_line_drawing", "ansi::tests::parse_designate_g1_as_line_drawing_and_invoke", "ansi::tests::parse_invalid_legacy_rgb_colors", "ansi::tests::parse_invalid_number", "ansi::tests::parse_invalid_rgb_colors", "ansi::tests::parse_numbe...
[]
[]
6
2022-02-10T00:17:22Z
alacritty/alacritty
5,788
alacritty__alacritty-5788
[ "5542" ]
60ef17e8e98b0ed219a145881d10ecd6b9f26e85
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - OSC 4 not handling `?` - `?` in OSC strings reporting default colors instead of modified ones +- OSC 104 not clearing colors when second...
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -1506,6 +1506,7 @@ mod tests { attr: Option<Attr>, identity_reported: bool, color: Option<Rgb>, + reset_colors: Vec<usize>, } ...
problems with OSC 4 and 104 [Documentation claims that OSC 4 and OSC 104 are supported](https://github.com/alacritty/alacritty/blob/master/docs/escape_support.md). However, testing reveals some issues. If the OSC is fully supported, we should be able to query the state of colors. Here's a working query using OSC 11:...
Querying the current value with `?` simply isn't implemented, should be trivial to do though if someone is interested. I would also like support for this. An additional problem is that the colors currently reported by `\e]11;?\a` are the original term colors rather than the (potentially) modified ones. I'm looking int...
2022-01-16T06:10:04
1.56
589c1e9c6b8830625162af14a9a7aee32c7aade0
[ "ansi::tests::parse_osc104_reset_all_colors" ]
[ "ansi::tests::parse_invalid_legacy_rgb_colors", "ansi::tests::parse_designate_g0_as_line_drawing", "ansi::tests::parse_designate_g1_as_line_drawing_and_invoke", "ansi::tests::parse_control_attribute", "ansi::tests::parse_invalid_number", "ansi::tests::parse_number_too_large", "ansi::tests::parse_invalid...
[]
[]
7
2022-01-20T23:57:59Z
ratatui/ratatui
1,226
ratatui__ratatui-1226
[ "1211" ]
935a7187c273e0efc876d094d6247d50e28677a3
diff --git a/src/buffer/buffer.rs b/src/buffer/buffer.rs --- a/src/buffer/buffer.rs +++ b/src/buffer/buffer.rs @@ -192,7 +192,7 @@ impl Buffer { } /// Print at most the first n characters of a string if enough space is available - /// until the end of the line. + /// until the end of the line. Skips z...
diff --git a/src/buffer/buffer.rs b/src/buffer/buffer.rs --- a/src/buffer/buffer.rs +++ b/src/buffer/buffer.rs @@ -931,4 +932,35 @@ mod tests { buf.set_string(0, 1, "bar", Style::new().blue()); assert_eq!(buf, Buffer::with_lines(["foo".red(), "bar".blue()])); } + + #[test] + fn control_sequ...
Visual glitch - Null character inside block wrapped component alters borders ## Description G'day, This one took me a while to investigate in a project so thought I'd report here in case it helps someone else. When a block wrapped widget contains text with a null character (eg `\0`), and is styled (e.g colour or b...
Thanks for reporting! oof, that must have been annoying to find. I think the solution for this is that `Line` or `Span` should probably strip all null characters? This is related to the recent unicode-width change in 0.1.13, which makes these characters now be measured as one character wide instead of 0 characters. Se...
2024-07-12T20:26:33
0.27
935a7187c273e0efc876d094d6247d50e28677a3
[ "buffer::buffer::tests::control_sequence_rendered_partially", "buffer::buffer::tests::control_sequence_rendered_full" ]
[ "backend::crossterm::tests::from_crossterm_color", "backend::crossterm::tests::from_crossterm_content_style_underline", "backend::crossterm::tests::from_crossterm_content_style", "backend::crossterm::tests::modifier::from_crossterm_attribute", "backend::crossterm::tests::modifier::from_crossterm_attributes"...
[ "backend::test::tests::buffer_view_with_overwrites" ]
[]
9
2024-07-17T11:22:02Z
ratatui/ratatui
518
ratatui__ratatui-518
[ "499" ]
c5ea656385843c880b3bef45dccbe8ea57431d10
diff --git a/src/widgets/barchart.rs b/src/widgets/barchart.rs --- a/src/widgets/barchart.rs +++ b/src/widgets/barchart.rs @@ -335,6 +335,26 @@ impl<'a> BarChart<'a> { } fn render_horizontal_bars(self, buf: &mut Buffer, bars_area: Rect, max: u64) { + // get the longest label + let label_size =...
diff --git a/src/widgets/barchart.rs b/src/widgets/barchart.rs --- a/src/widgets/barchart.rs +++ b/src/widgets/barchart.rs @@ -1093,6 +1119,21 @@ mod tests { test_horizontal_bars_label_width_greater_than_bar(Some(Color::White)) } + /// Tests horizontal bars label are presents + #[test] + fn tes...
Horizontal Barchart does not print labels ## Description Horizontal Barcharts were added recently (0.23.0), but labels were not implemented. Barcharts have two label types: label and text_value (a formatted version of the value), only the latter is rendered. ## To Reproduce ```rust let data = vec![ ("Jan", ...
I can work on that. I'm wondering how should we handle something like this. ```rust let data = vec![ ("January", 10), ("February", 20), ("March", 30), ("April", 40), ("May", 50), ("June", 60), ]; ``` Bars should always be aligned so we have to have a max label length somehow. ...
2023-09-19T23:43:13
0.23
3bda37284781b62560cde2a7fa774211f651ec25
[ "widgets::barchart::tests::test_horizontal_label" ]
[ "backend::test::tests::assert_buffer_panics - should panic", "backend::test::tests::assert_buffer", "backend::test::tests::resize", "backend::test::tests::get_cursor", "backend::test::tests::test_buffer_view", "backend::test::tests::draw", "backend::tests::clear_type_from_str", "backend::tests::clear_...
[ "backend::test::tests::buffer_view_with_overwrites", "buffer::tests::buffer_set_string_zero_width", "widgets::paragraph::test::zero_width_char_at_end_of_line", "widgets::reflow::test::line_composer_zero_width_at_end" ]
[]
10
2023-09-22T07:41:04Z
ratatui/ratatui
323
ratatui__ratatui-323
[ "322" ]
446efae185a5bb02a9ab6481542d1dc3024b66a9
diff --git a/src/title.rs b/src/title.rs --- a/src/title.rs +++ b/src/title.rs @@ -50,8 +50,8 @@ impl<'a> Default for Title<'a> { fn default() -> Self { Self { content: Line::from(""), - alignment: Some(Alignment::Left), - position: Some(Position::Top), + alig...
diff --git a/src/widgets/block.rs b/src/widgets/block.rs --- a/src/widgets/block.rs +++ b/src/widgets/block.rs @@ -515,6 +515,7 @@ impl<'a> Styled for Block<'a> { mod tests { use super::*; use crate::{ + assert_buffer_eq, layout::Rect, style::{Color, Modifier, Stylize}, }; diff ...
`title_alignment` does not work as expected ## Description `title_alignment` does not have effect on `Block` title when used without `Title`. ## To Reproduce ```rs fn ui<B: Backend>(f: &mut Frame<B>) { let size = f.size(); let block = Block::default() .borders(Borders::ALL) .titl...
2023-07-16T23:26:44
0.21
446efae185a5bb02a9ab6481542d1dc3024b66a9
[ "widgets::block::tests::title_alignment", "widgets_block_title_alignment" ]
[ "buffer::tests::buffer_merge3", "buffer::tests::buffer_merge2", "buffer::tests::buffer_diffing_multi_width_offset", "buffer::tests::buffer_set_string", "buffer::tests::buffer_set_string_double_width", "buffer::tests::buffer_set_string_multi_width_overwrite", "buffer::tests::buffer_diffing_multi_width", ...
[ "buffer::tests::buffer_set_string_zero_width", "widgets::paragraph::test::zero_width_char_at_end_of_line", "widgets::reflow::test::line_composer_zero_width_at_end", "src/backend/termwiz.rs - backend::termwiz::TermwizBackend (line 27)" ]
[]
11
2023-07-17T10:28:15Z
ratatui/ratatui
911
ratatui__ratatui-911
[ "910" ]
d2d91f754c87458c6d07863eca20f3ea8ae319ce
diff --git a/src/widgets/scrollbar.rs b/src/widgets/scrollbar.rs --- a/src/widgets/scrollbar.rs +++ b/src/widgets/scrollbar.rs @@ -454,7 +454,7 @@ impl<'a> StatefulWidget for Scrollbar<'a> { let area = self.scollbar_area(area); for x in area.left()..area.right() { for y in area.top()..are...
diff --git a/src/widgets/scrollbar.rs b/src/widgets/scrollbar.rs --- a/src/widgets/scrollbar.rs +++ b/src/widgets/scrollbar.rs @@ -769,6 +769,83 @@ mod tests { ); } + #[rstest] + #[case("█████ ", 0, 10, "position_0")] + #[case(" █████ ", 1, 10, "position_1")] + #[case(" █████ ", 2,...
Scrollbar with `.track_symbol(None)` renders incorrectly ## Description https://github.com/ratatui-org/ratatui/assets/1813121/03646e25-aa2a-41de-ba0b-d0397862de3a Using code like this causes the problem: ```rust f.render_stateful_widget(Scrollbar::default().begin_symbol(None).end_symbol(None), area, &mut ...
2024-02-03T18:02:50
0.26
943c0431d968a82b23a2f31527f32e57f86f8a7c
[ "widgets::scrollbar::tests::render_scrollbar_without_track_symbols::case_04", "widgets::scrollbar::tests::render_scrollbar_without_track_symbols::case_03", "widgets::scrollbar::tests::render_scrollbar_without_track_symbols::case_05", "widgets::scrollbar::tests::render_scrollbar_without_track_symbols::case_02"...
[ "backend::crossterm::tests::from_crossterm_color", "backend::termwiz::tests::into_color::from_ansicolor", "backend::crossterm::tests::modifier::from_crossterm_attributes", "backend::termion::tests::from_termion_bg", "backend::crossterm::tests::from_crossterm_content_style", "backend::termwiz::tests::into_...
[ "backend::test::tests::buffer_view_with_overwrites", "buffer::buffer::tests::set_string_zero_width", "widgets::paragraph::test::zero_width_char_at_end_of_line", "widgets::reflow::test::line_composer_zero_width_at_end" ]
[]
13
2024-02-03T15:06:45Z
ron-rs/ron
114
ron-rs__ron-114
[ "113" ]
1d86009a18c62600f811b8596f585f2e02f5f1dc
diff --git a/src/de/mod.rs b/src/de/mod.rs --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -122,7 +122,7 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> { b'[' => self.deserialize_seq(visitor), b'{' => self.deserialize_map(visitor), b'0'...b'9' | b'+' | b'-' | b'.'...
diff --git /dev/null b/tests/value.rs new file mode 100644 --- /dev/null +++ b/tests/value.rs @@ -0,0 +1,65 @@ +extern crate ron; + +use std::collections::BTreeMap; + +use ron::value::{Number, Value}; + +#[test] +fn bool() { + assert_eq!(Value::from_str("true"), Ok(Value::Bool(true))); + assert_eq!(Value::from_st...
Forgot to hook up raw string literals with deserialize_any I made a mistake in #112 where I forgot to update [the appropriate branch](https://github.com/ron-rs/ron/blob/master/src/de/mod.rs#L125) in `de/mod.rs` to work with raw string literals. The match pattern should be `b'"' | b'r'` in order for raw string literal d...
2018-06-06T22:32:54
0.2
1d86009a18c62600f811b8596f585f2e02f5f1dc
[ "string" ]
[ "de::tests::expected_attribute", "de::tests::expected_attribute_end", "de::tests::forgot_apostrophes", "de::tests::implicit_some", "de::tests::invalid_attribute", "de::tests::multiple_attributes", "de::tests::test_array", "de::tests::test_char", "de::tests::test_comment", "de::tests::test_empty_st...
[ "test_nul_in_string" ]
[]
14
2018-06-08T08:22:07Z
ron-rs/ron
108
ron-rs__ron-108
[ "107" ]
5efdf123de373ec466b3dbfd0c61a4f6991a0127
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ron" -version = "0.2.1" +version = "0.2.2" license = "MIT/Apache-2.0" keywords = ["parser", "serde", "serialization"] authors = [ diff --git a/src/de/mod.rs b/src/de/mod.rs --- a/src/de/mod.rs +++ b/src/de/mod....
diff --git a/src/de/tests.rs b/src/de/tests.rs --- a/src/de/tests.rs +++ b/src/de/tests.rs @@ -258,3 +258,8 @@ fn implicit_some() { // Not concise assert_eq!(de::<Option<Option<char>>>("None"), None); } + +#[test] +fn ws_tuple_newtype_variant() { + assert_eq!(Ok(MyEnum::B(true)), from_str("B ( \n true \n...
`to_string` produces text that `from_str` does not accept (with tuple variants) ``` # Cargo.toml ron = "0.2.1" ``` --- Given the following type: ```rust pub enum FileOrMem { File(String), Memory, } ``` `ser::to_string` produces the following RON: ``` data: Node ( ...
Was this fixed in https://github.com/ron-rs/ron/commit/239cb7919ff06abdf2bd40514b16f39d6c3786f4? Possibly, at least there was a similar bug. Or in https://github.com/ron-rs/ron/commit/713284f17ab1b0883f0206c50e08d2c88b80e061
2018-05-20T12:41:47
0.2
1d86009a18c62600f811b8596f585f2e02f5f1dc
[ "de::tests::ws_tuple_newtype_variant" ]
[ "de::tests::expected_attribute", "de::tests::expected_attribute_end", "de::tests::forgot_apostrophes", "de::tests::invalid_attribute", "de::tests::implicit_some", "de::tests::multiple_attributes", "de::tests::test_array", "de::tests::test_char", "de::tests::test_empty_struct", "de::tests::test_com...
[ "test_nul_in_string" ]
[]
16
2018-05-20T04:44:51Z
ron-rs/ron
103
ron-rs__ron-103
[ "102" ]
a5a4b2ee21f5be0b07c55844e2689ae8a521da3b
diff --git a/src/de/mod.rs b/src/de/mod.rs --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -313,6 +313,7 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> { self.bytes.skip_ws()?; if self.bytes.consume("(") { + self.bytes.skip_ws()?; let value = visitor.visit_ne...
diff --git a/tests/big_struct.rs b/tests/big_struct.rs --- a/tests/big_struct.rs +++ b/tests/big_struct.rs @@ -39,8 +39,12 @@ pub struct ImGuiStyleSave { pub anti_aliased_shapes: bool, pub curve_tessellation_tol: f32, pub colors: ImColorsSave, + pub new_type: NewType, } +#[derive(Serialize, Deseria...
Parser doesn't handle whitespace ... between `(` and `[` of a `newtype_struct` wrapping a `seq`: ```rust #[derive(Debug, Deserialize)] struct Newtype(Vec<String>); fn main() { let serialized = stringify!( Newtype([ "a", "b", "c", ]) ); pr...
2018-04-26T19:22:39
0.2
1d86009a18c62600f811b8596f585f2e02f5f1dc
[ "deserialize_big_struct" ]
[ "de::tests::forgot_apostrophes", "de::tests::expected_attribute_end", "de::tests::expected_attribute", "de::tests::invalid_attribute", "de::tests::multiple_attributes", "de::tests::implicit_some", "de::tests::test_array", "de::tests::test_char", "de::tests::test_empty_struct", "de::tests::test_com...
[ "test_nul_in_string" ]
[]
17
2018-04-27T13:01:38Z
ron-rs/ron
80
ron-rs__ron-80
[ "49" ]
83f67a083bb22c000164052d80b9a559084f3f80
diff --git a/src/parse.rs b/src/parse.rs --- a/src/parse.rs +++ b/src/parse.rs @@ -81,29 +81,52 @@ impl<'a> Bytes<'a> { } pub fn char(&mut self) -> Result<char> { + use std::cmp::min; + if !self.consume("'") { return self.err(ParseError::ExpectedChar); } - let ...
diff --git /dev/null b/tests/unicode.rs new file mode 100644 --- /dev/null +++ b/tests/unicode.rs @@ -0,0 +1,15 @@ +extern crate ron; + +use ron::de::from_str; + +#[test] +fn test_char() { + let de: char = from_str("'Փ'").unwrap(); + assert_eq!(de, 'Փ'); +} + +#[test] +fn test_string() { + let de: String = fro...
Properly handle unicode I'm pretty sure unicode support isn't fully implemented, so we would need tests and full support in serializer and deserializer. Additionally, rules should go into the spec (probably in a text document in this repository, as suggested somewhere).
2018-01-20T21:46:43
0.2
1d86009a18c62600f811b8596f585f2e02f5f1dc
[ "test_char" ]
[ "de::tests::expected_attribute", "de::tests::expected_attribute_end", "de::tests::forgot_apostrophes", "de::tests::multiple_attributes", "de::tests::invalid_attribute", "de::tests::implicit_some", "de::tests::test_array", "de::tests::test_char", "de::tests::test_comment", "de::tests::test_empty_st...
[]
[]
18
2018-01-20T18:48:40Z
ron-rs/ron
512
ron-rs__ron-512
[ "511" ]
1ff0efa8c87590b14af8a9d61e1fa7288c7455f1
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix serialising reserved identifiers `true`, `false`, `Some`, `None`, `inf`[`f32`|`f64`], and `Nan`[`f32`|`f64`] ([#487](https://github.com...
diff --git /dev/null b/tests/511_deserialize_any_map_string_key.rs new file mode 100644 --- /dev/null +++ b/tests/511_deserialize_any_map_string_key.rs @@ -0,0 +1,76 @@ +#[test] +fn test_map_custom_deserialize() { + use std::collections::HashMap; + + #[derive(PartialEq, Debug)] + struct CustomMap(HashMap<Strin...
Problem deserializing maps when deserialization target expect owned String keys I just encountered this somewhat strange behavior. Trying to deserialize a very simple RON string into a `serde_json::Value` fails with an `ExpectedIdentifier` error: ```rust let json: serde_json::Value = ron::from_str("(f1: 0, f2: ...
Thank you @grindvoll for reporting and investigating this issue! This sounds like an easy-enough change to me. Would you like to file a PR yourself that also adds a test with your usecase? I'm unfortunately quite swamped with uni at the moment. Ok, I will try to file a PR with unit test as soon as possible.
2023-10-02T22:33:22
0.9
d3e9ebee2cb9dd7e1ed1ae3d6ed4bea6e05a139d
[ "test_map_custom_deserialize", "test_ron_struct_as_json_map" ]
[ "de::tests::expected_attribute", "de::tests::expected_attribute_end", "de::tests::boolean_struct_name", "de::tests::forgot_apostrophes", "de::tests::invalid_attribute", "de::tests::implicit_some", "de::tests::multiple_attributes", "de::tests::rename", "de::tests::test_char", "de::tests::test_comme...
[]
[]
19
2023-10-07T05:57:18Z
ron-rs/ron
225
ron-rs__ron-225
[ "174", "174" ]
c6873c6f8a953c5532174baa02937b00558996f5
diff --git a/src/ser/mod.rs b/src/ser/mod.rs --- a/src/ser/mod.rs +++ b/src/ser/mod.rs @@ -224,7 +224,7 @@ impl Serializer { fn is_pretty(&self) -> bool { match self.pretty { - Some((ref config, ref pretty)) => pretty.indent < config.depth_limit, + Some((ref config, ref pretty)) =>...
diff --git a/tests/depth_limit.rs b/tests/depth_limit.rs --- a/tests/depth_limit.rs +++ b/tests/depth_limit.rs @@ -49,7 +49,7 @@ fn depth_limit() { }; let pretty = ron::ser::PrettyConfig::new() - .with_depth_limit(2) + .with_depth_limit(1) .with_separate_tuple_members(true) ....
Depth limit seems to be off by one Currently, a depth limit of `1` means that nothing gets indented (same for `0`). That seems wrong, as the limit should be the (inclusive) maximum depth. This can be fixed by changing the `pretty.indent < config.ident` to a `<=` check. @kvark Do you agree this is a bug? Depth lim...
yeah, let's fix this Bump :) PR's welcome! yeah, let's fix this Bump :) PR's welcome!
2020-05-03T07:28:48
0.5
c6873c6f8a953c5532174baa02937b00558996f5
[ "depth_limit" ]
[ "de::tests::expected_attribute", "de::tests::expected_attribute_end", "de::tests::forgot_apostrophes", "de::tests::invalid_attribute", "de::tests::implicit_some", "de::tests::multiple_attributes", "de::tests::test_any_number_precision", "de::tests::test_char", "de::tests::test_array", "de::tests::...
[ "test_adjacently_a_de", "test_adjacently_a_ser", "test_adjacently_b_de", "test_adjacently_b_ser", "test_nul_in_string" ]
[]
24
2020-05-03T16:42:37Z
ron-rs/ron
324
ron-rs__ron-324
[ "322" ]
4993b34e5bc3da8d5977acbf3d89b7032a45ead9
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/...
diff --git /dev/null b/tests/322_escape_idents.rs new file mode 100644 --- /dev/null +++ b/tests/322_escape_idents.rs @@ -0,0 +1,35 @@ +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +#[derive(Debug, Deserialize, PartialEq, Serialize)] +#[serde(rename_all = "kebab-case")] +enum MyEnumWithDashes ...
Identifiers get serialized without raw ident escape Minimal example: ```rust #[derive(Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "kebab-case")] struct MyStructWithDash { will_be_renamed: u32, } #[test] fn roundtrip_ident_with_dash() { let value = MyStructWithDash { wil...
2021-10-22T15:39:40
0.6
4993b34e5bc3da8d5977acbf3d89b7032a45ead9
[ "roundtrip_ident_with_dash" ]
[ "de::tests::expected_attribute", "de::tests::expected_attribute_end", "de::tests::forgot_apostrophes", "de::tests::invalid_attribute", "de::tests::implicit_some", "de::tests::multiple_attributes", "de::tests::rename", "de::tests::test_any_number_precision", "de::tests::test_array", "de::tests::tes...
[ "test_adjacently_a_de", "test_adjacently_a_ser", "test_adjacently_b_de", "test_adjacently_b_ser", "test_nul_in_string" ]
[]
25
2021-10-22T07:42:14Z
artichoke/artichoke
2,073
artichoke__artichoke-2073
[ "2072" ]
b3284a42fb0d175da1a822bda73bd300ddab72c3
diff --git a/spinoso-time/src/time/tzrs/parts.rs b/spinoso-time/src/time/tzrs/parts.rs --- a/spinoso-time/src/time/tzrs/parts.rs +++ b/spinoso-time/src/time/tzrs/parts.rs @@ -316,7 +316,7 @@ impl Time { self.inner.local_time_type().is_dst() } - /// Returns an integer representing the day of the week,...
diff --git a/spinoso-time/src/time/tzrs/parts.rs b/spinoso-time/src/time/tzrs/parts.rs --- a/spinoso-time/src/time/tzrs/parts.rs +++ b/spinoso-time/src/time/tzrs/parts.rs @@ -550,4 +550,29 @@ mod tests { assert_eq!("UTC", dt.time_zone()); assert!(dt.is_utc()); } + + #[test] + fn yday() { + ...
The doc of `spinoso_time::tzrs::Time::day_of_year()` is inconsistent with its implementation The doc of `spinoso_time::tzrs::Time::day_of_year()` is inconsistent with its implementation: https://github.com/artichoke/artichoke/blob/b3284a42fb0d175da1a822bda73bd300ddab72c3/spinoso-time/src/time/tzrs/parts.rs#L511-L533. ...
2022-08-11T23:52:40
1.62
b3284a42fb0d175da1a822bda73bd300ddab72c3
[ "time::tzrs::parts::tests::yday" ]
[ "time::chrono::build::tests::time_at_with_max_i64_overflow", "time::chrono::build::tests::time_at_with_min_i64_overflow", "time::chrono::build::tests::time_at_with_overflowing_negative_sub_second_nanos", "time::chrono::build::tests::time_at_with_negative_sub_second_nanos", "time::chrono::build::tests::time_...
[]
[]
26
2022-08-11T16:20:21Z
async-graphql/async-graphql
1,228
async-graphql__async-graphql-1228
[ "1223" ]
dc140a55012ab4fd671fc4974f3aed7b0de23c7a
diff --git a/src/dynamic/resolve.rs b/src/dynamic/resolve.rs --- a/src/dynamic/resolve.rs +++ b/src/dynamic/resolve.rs @@ -336,7 +336,13 @@ fn collect_fields<'a>( type_condition.map(|condition| condition.node.on.node.as_str()); let introspection_type_name = &object.name; - ...
diff --git a/src/dynamic/interface.rs b/src/dynamic/interface.rs --- a/src/dynamic/interface.rs +++ b/src/dynamic/interface.rs @@ -389,4 +389,47 @@ mod tests { }] ); } + #[tokio::test] + async fn query_type_condition() { + struct MyObjA; + let obj_a = Object::new("MyObjA")...
dynamic schema: query interface on union not working ## Expected Behavior when we have a union of objects that some of which implements an interface, we should be able to query the union by the interface. In the following example, if the `pet` is queried by the `Named` interface, we expect the `name` field and `__ty...
2023-02-07T17:56:55
5.0
dc140a55012ab4fd671fc4974f3aed7b0de23c7a
[ "dynamic::union::tests::test_query", "dynamic::interface::tests::query_type_condition" ]
[ "dataloader::tests::test_dataloader", "dynamic::interface::tests::basic_interface", "dataloader::tests::test_duplicate_keys", "dataloader::tests::test_dataloader_disable_all_cache", "dynamic::input_object::tests::oneof_input_object", "dynamic::scalar::tests::custom_scalar", "dynamic::input_object::tests...
[]
[]
27
2023-02-09T17:25:24Z
async-graphql/async-graphql
1,559
async-graphql__async-graphql-1559
[ "1558" ]
faa78d071cfae795dacc39fd46900fdfb6157d0d
diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -259,10 +259,8 @@ impl Registry { write!(sdl, " @tag(name: \"{}\")", tag.replace('"', "\\\"")).ok(); } } - ...
diff --git a/tests/schemas/test_fed2_compose_2.schema.graphql b/tests/schemas/test_fed2_compose_2.schema.graphql --- a/tests/schemas/test_fed2_compose_2.schema.graphql +++ b/tests/schemas/test_fed2_compose_2.schema.graphql @@ -3,7 +3,7 @@ type Query { - testArgument(arg: String! @type_directive_argument_definition...
The custom directive ARGUMENT_DEFINITION is not being output at the appropriate location in SDL ## Rust Code ```rust use async_graphql::*; #[TypeDirective(location = "ArgumentDefinition")] fn testDirective(desc: String) {} struct Query; #[Object] impl Query { async fn add( &self, #...
2024-07-09T18:56:37
7.0
faa78d071cfae795dacc39fd46900fdfb6157d0d
[ "test_type_directive_2" ]
[ "dataloader::tests::test_dataloader_load_empty", "dynamic::check::tests::test_recursive_input_objects_local_cycle", "dynamic::check::tests::test_recursive_input_objects", "dynamic::check::tests::test_recursive_input_objects_bad", "dataloader::tests::test_dataloader_disable_all_cache", "dataloader::tests::...
[]
[]
28
2024-07-14T02:17:22Z
async-graphql/async-graphql
1,524
async-graphql__async-graphql-1524
[ "1187" ]
9d1befde1444a3d6a9dfdc62750ba271159c7173
diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -95,15 +95,6 @@ impl Registry { pub(crate) fn export_sdl(&self, options: SDLExportOptions) -> String { let mut sdl = String::new(); - let has_oneof = self - ...
diff --git a/tests/directive.rs b/tests/directive.rs --- a/tests/directive.rs +++ b/tests/directive.rs @@ -1,4 +1,5 @@ use async_graphql::*; +use serde::{Deserialize, Serialize}; #[tokio::test] pub async fn test_directive_skip() { diff --git a/tests/directive.rs b/tests/directive.rs --- a/tests/directive.rs +++ b/...
Oneof directive not included in introspection result ## Expected Behavior I would expect the `@oneof` directive to be included in the result of an introspection query whenever the `#[derive(OneofObject)]` macro is used on a struct. ## Actual Behavior The directive is not listed in the introspection query result: ...
GraphiQL doesn't seem to support oneof. `Type` contains `oneOf` field, but GraphiQL is not querying it. https://github.com/async-graphql/async-graphql/blob/e2e35ce93f1032d6467144c7fa8f0783e1dde04b/src/model/type.rs#L241 Yes, that is true. Probably because it is still in RFC2 (Draft) phase. They renamed it to `isO...
2024-05-18T22:33:38
7.0
faa78d071cfae795dacc39fd46900fdfb6157d0d
[ "test_includes_specified_by_directive", "test_includes_deprecated_directive", "test_introspection_directives", "test_type_directive_2" ]
[ "dataloader::tests::test_dataloader_disable_cache", "dataloader::tests::test_dataloader_load_empty", "dataloader::tests::test_dataloader", "dynamic::check::tests::test_recursive_input_objects_local_cycle", "dataloader::tests::test_dataloader_disable_all_cache", "dynamic::check::tests::test_recursive_input...
[]
[]
30
2024-05-19T00:59:07Z
tokio-rs/axum
868
tokio-rs__axum-868
[ "865" ]
422a883cb2a81fa6fbd2f2a1affa089304b7e47b
diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -71,6 +71,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 be accepted but most likely result in bugs ([#823]) - **breaking:** `Headers` has been removed. Arrays of tuples dire...
diff --git a/axum/src/json.rs b/axum/src/json.rs --- a/axum/src/json.rs +++ b/axum/src/json.rs @@ -244,4 +264,19 @@ mod tests { assert!(valid_json_content_type("application/cloudevents+json").await); assert!(!valid_json_content_type("text/json").await); } + + #[tokio::test] + async fn inval...
HTTP Status on Invalid JSON Request When I send a request where the `content-type` is not `application/json` I get the answer `415 Unsupported Media Type` and if the JSON parsing fails I get `422 Unprocessable Entity` Two issues: 1. This is not documented correctly: https://docs.rs/axum/latest/axum/struct.Json.ht...
👍🏼 for distinguishing syntactic errors and content errors. `serde_json::Error` has a `classify()` method that allows to check what failed exactly. > This is not documented correctly: https://docs.rs/axum/latest/axum/struct.Json.html In this documentation both of them would result in 400 Bad Request Good catch. Tha...
2022-03-18T01:15:56
0.4
2e5d56a9b125142817378883b098470d05ab0597
[ "json::tests::invalid_json_syntax" ]
[ "body::stream_body::stream_body_traits", "extract::connect_info::traits", "error_handling::traits", "extract::extractor_middleware::traits", "extract::form::tests::test_form_query", "extract::form::tests::test_form_body", "extract::form::tests::test_incorrect_content_type", "extract::path::de::tests::...
[]
[]
31
2022-03-18T15:53:41Z
tokio-rs/axum
529
tokio-rs__axum-529
[ "488" ]
f9a437d0813c0e2f784ca90eccccb4fbad9126cb
diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -28,10 +28,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **breaking:** The `Handler<B, T>` trait is now defined as `Handler<T, B = Body>`. That is the type parameters have...
diff --git a/axum/src/routing/tests/fallback.rs b/axum/src/routing/tests/fallback.rs --- a/axum/src/routing/tests/fallback.rs +++ b/axum/src/routing/tests/fallback.rs @@ -49,25 +49,3 @@ async fn or() { assert_eq!(res.status(), StatusCode::OK); assert_eq!(res.text().await, "fallback"); } - -#[tokio::test] -as...
Panic if merging two routers that each have a fallback Currently when you `Router::merge` two routes that each have a fallback it'll pick the fallback of the router on the right hand side, and if only one has a fallback it'll pick that one. This might lead users to think that multiple fallbacks are supported (see https...
👍 for panicking. Silently discarding a fallback service will almost definitely end up causing issue for someone.
2021-11-17T06:44:32
0.3
939995e80edaf4e882a6e2decb07db5a7c0a2c06
[ "routing::tests::merging_routers_with_fallbacks_panics - should panic", "routing::tests::nesting_router_with_fallbacks_panics - should panic" ]
[ "body::stream_body::stream_body_traits", "error_handling::traits", "extract::connect_info::traits", "extract::extractor_middleware::traits", "extract::path::de::tests::test_parse_map", "extract::path::de::tests::test_parse_struct", "extract::path::de::tests::test_parse_seq", "extract::form::tests::tes...
[]
[]
32
2021-11-18T21:19:07Z
sharkdp/bat
1,556
sharkdp__bat-1556
[ "1550" ]
c569774e1a8528fab91225dabdadf53fde3916ea
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - If `PAGER` (but not `BAT_PAGER` or `--pager`) is `more` or `most`, silently use `less` instead to ensure support for colors, see #1063 (@Enselic) - If `PAGER` is `bat`, silently use `less` to prevent recursion. For `BAT...
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -652,6 +652,13 @@ fn config_location_test() { .assert() .success() .stdout("bat.conf\n"); + + bat_with_config() + .env("BAT_CONFIG_PATH", "not-ex...
BAT_CONFIG_PATH ignored by --generate-config-file <!-- Hey there, thank you for creating an issue! --> **What version of `bat` are you using?** <!-- Output of `bat --version` --> Newest **Describe the bug you encountered:** ![image](https://user-images.githubusercontent.com/55729509/108675764-3694ee80-7522-1...
Thank you for reporting this. Looks like a bug indeed. I can confirm this bug, which is generic. It is caused by ``` .filter(|config_path| config_path.is_file()) ``` in ``` pub fn config_file() -> PathBuf { env::var("BAT_CONFIG_PATH") .ok() .map(PathBuf::from) .filter(|conf...
2021-02-27T19:22:32
0.17
c569774e1a8528fab91225dabdadf53fde3916ea
[ "config_location_test" ]
[ "config::default_config_should_highlight_no_lines", "config::default_config_should_include_all_lines", "input::basic", "input::utf16le", "less::test_parse_less_version_487", "less::test_parse_less_version_wrong_program", "less::test_parse_less_version_551", "less::test_parse_less_version_529", "line...
[]
[]
33
2021-02-28T14:19:15Z
sharkdp/bat
2,698
sharkdp__bat-2698
[ "2674" ]
8e35a567121a7186d77e12e249490210c6eb75a9
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ - Fix `more` not being found on Windows when provided via `BAT_PAGER`, see #2570, #2580, and #2651 (@mataha) - Switched default behavior of `--map-syntax` to be case insensitive #2520 - Updated version of `serde_yaml` to...
diff --git a/src/line_range.rs b/src/line_range.rs --- a/src/line_range.rs +++ b/src/line_range.rs @@ -128,6 +128,13 @@ fn test_parse_plus() { assert_eq!(50, range.upper); } +#[test] +fn test_parse_plus_overflow() { + let range = LineRange::from(&format!("{}:+1", usize::MAX)).expect("Shouldn't fail on test!"...
Arithmetic overflow occurs while using API LineRange::from() <!-- Hey there, thank you for reporting a bug! Please note that the following bugs have already been reported: * dpkg: error processing archive /some/path/some-program.deb (--unpack): trying to overwrite '/usr/.crates2.json' See https://githu...
Maybe `saturating_add(new_range.lower, more_lines)` can be done here to avoid panicking. > Maybe `saturating_add(new_range.lower, more_lines)` can be done here to avoid panicking. Looks nice, better than `assert!`.
2023-10-05T05:59:46
0.23
8e35a567121a7186d77e12e249490210c6eb75a9
[ "line_range::test_parse_plus_overflow" ]
[ "assets::build_assets::acknowledgements::tests::test_append_to_acknowledgements_adds_newline_if_missing", "assets::build_assets::acknowledgements::tests::test_normalize_license_text", "assets::build_assets::acknowledgements::tests::test_normalize_license_text_with_windows_line_endings", "config::default_confi...
[ "long_help", "short_help" ]
[]
34
2023-10-05T07:20:10Z
bevyengine/bevy
10,211
bevyengine__bevy-10211
[ "10207" ]
6f27e0e35faffbf2b77807bb222d3d3a9a529210
diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs --- a/crates/bevy_ecs/macros/src/lib.rs +++ b/crates/bevy_ecs/macros/src/lib.rs @@ -201,6 +201,10 @@ pub fn impl_param_set(_input: TokenStream) -> TokenStream { #param::init_state(world, &mut #meta); ...
diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -1739,4 +1739,34 @@ mod tests { schedule.add_systems(non_sync_system); schedule.run(&mut world); ...
`NonSendMut` is allowed to run on the wrong thread when used in a `ParamSet` ## Bevy version 0.11 ## What you did I put a `NonSendMut<T>` type in a `ParamSet`. ```rust use bevy::prelude::*; fn main() { App::new() .add_plugins(DefaultPlugins) .insert_non_send_resource(T(std::ptr::n...
2023-10-21T10:17:22
1.70
6f27e0e35faffbf2b77807bb222d3d3a9a529210
[ "system::system_param::tests::param_set_non_send_first", "system::system_param::tests::param_set_non_send_second" ]
[ "change_detection::tests::map_mut", "change_detection::tests::mut_from_non_send_mut", "change_detection::tests::mut_new", "change_detection::tests::as_deref_mut", "change_detection::tests::mut_untyped_to_reflect", "change_detection::tests::mut_from_res_mut", "change_detection::tests::change_tick_wraparo...
[]
[]
35
2023-10-21T18:29:29Z
bevyengine/bevy
12,574
bevyengine__bevy-12574
[ "12570" ]
7c7d1e8a6442a4258896b6c605beb1bf50399396
diff --git a/crates/bevy_math/src/cubic_splines.rs b/crates/bevy_math/src/cubic_splines.rs --- a/crates/bevy_math/src/cubic_splines.rs +++ b/crates/bevy_math/src/cubic_splines.rs @@ -2,6 +2,7 @@ use std::{ fmt::Debug, + iter::once, ops::{Add, Div, Mul, Sub}, }; diff --git a/crates/bevy_math/src/cubic...
diff --git a/crates/bevy_math/src/cubic_splines.rs b/crates/bevy_math/src/cubic_splines.rs --- a/crates/bevy_math/src/cubic_splines.rs +++ b/crates/bevy_math/src/cubic_splines.rs @@ -1275,6 +1295,37 @@ mod tests { assert_eq!(bezier.ease(1.0), 1.0); } + /// Test that a simple cardinal spline passes th...
Somethin' ain't right with cardinal splines ## The issue There is a mismatch between what the [documentation says](https://docs.rs/bevy/latest/bevy/math/cubic_splines/struct.CubicCardinalSpline.html) and how `CubicCardinalSpline` actually works. Namely, this: > ### Interpolation > > The curve passes through ev...
Additional context which originated the issue: [on discord help channel](https://discordapp.com/channels/691052431525675048/1219580704824889424/1219580704824889424). Looks like a bug to me. Docs state the classic properties of cardinals. I will need to review the history to see if this issue existed before I reworded t...
2024-03-20T00:25:28
1.76
c9ec95d7827297528d0779e3fd232dfc2e3cbed7
[ "cubic_splines::tests::cardinal_control_pts" ]
[ "bounding::bounded2d::aabb2d_tests::area", "bounding::bounded2d::aabb2d_tests::center", "bounding::bounded2d::aabb2d_tests::closest_point", "bounding::bounded2d::aabb2d_tests::grow", "bounding::bounded2d::aabb2d_tests::contains", "bounding::bounded2d::aabb2d_tests::half_size", "bounding::bounded2d::aabb...
[]
[]
36
2024-03-22T10:50:53Z
bevyengine/bevy
10,103
bevyengine__bevy-10103
[ "10086" ]
88599d7fa06dff6bba434f3a91b57bf8f483f158
diff --git a/crates/bevy_reflect/src/serde/ser.rs b/crates/bevy_reflect/src/serde/ser.rs --- a/crates/bevy_reflect/src/serde/ser.rs +++ b/crates/bevy_reflect/src/serde/ser.rs @@ -68,7 +68,22 @@ impl<'a> Serialize for ReflectSerializer<'a> { { let mut state = serializer.serialize_map(Some(1))?; st...
diff --git a/crates/bevy_reflect/src/serde/mod.rs b/crates/bevy_reflect/src/serde/mod.rs --- a/crates/bevy_reflect/src/serde/mod.rs +++ b/crates/bevy_reflect/src/serde/mod.rs @@ -8,7 +8,7 @@ pub use type_data::*; #[cfg(test)] mod tests { - use crate::{self as bevy_reflect, DynamicTupleStruct}; + use crate::{s...
Potential reflect issue: DynamicStruct not registered ## Bevy version version: current main branch ## What you did While migrating my crate to the current bevy main, I am facing the current error: "No registration found for bevy_reflect::DynamicStruct" when deserializing a reflected component. This worked in ...
@MrGVSV I don't follow exactly what's going on / broke here, but this looks like a regression. Yeah this seems to be an issue with the recent changes to how `TypePath` is used in the reflection serializer. I'll make a PR!
2023-10-13T07:39:42
1.70
6f27e0e35faffbf2b77807bb222d3d3a9a529210
[ "serde::tests::should_not_serialize_unproxied_dynamic - should panic", "serde::tests::should_roundtrip_proxied_dynamic" ]
[ "enums::tests::applying_non_enum_should_panic - should panic", "enums::tests::dynamic_enum_should_apply_dynamic_enum", "enums::tests::enum_should_allow_struct_fields", "enums::tests::dynamic_enum_should_change_variant", "enums::tests::dynamic_enum_should_set_variant_fields", "enums::tests::enum_should_ret...
[]
[]
37
2023-10-17T00:03:37Z
bincode-org/bincode
198
bincode-org__bincode-198
[ "193" ]
131b2b213dedc34bea0edc98298770eb4eb0c74a
diff --git a/src/config/legacy.rs b/src/config/legacy.rs --- a/src/config/legacy.rs +++ b/src/config/legacy.rs @@ -49,6 +49,7 @@ macro_rules! config_map { (Unlimited, Little) => { let $opts = DefaultOptions::new() .with_fixint_encoding() + .allow_tra...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -277,6 +277,17 @@ fn deserializing_errors() { } } +#[test] +fn trailing_bytes() { + match DefaultOptions::new() + .deserialize::<char>(b"1x") + .map_err(|e| *e) + { + Err(ErrorKind::Custom(_)) => {} ...
Reject trailing bytes when deserializing from &[u8] In `deserialize_from`, it makes sense to allow deserializing multiple values from the same io::Read. But in `deserialize`, I think trailing data should be an error. I would expect this to be an error rather than ignoring `b"x"`: ```rust extern crate bincode; ...
@dtolnay Is this issue in response to my question: https://github.com/TyOverby/bincode/issues/192 ? Does it mean that multiple serialised messages (differing by trailing bytes) can deserialise to the same content? https://github.com/TyOverby/bincode/issues/192#issuecomment-313660286 gives a workaround to detect trai...
2017-07-24T08:07:44
1.2
263fb948aca86d3ac5dfa5bc4f345b44ed8bb8f8
[ "trailing_bytes" ]
[ "config::int::test::test_zigzag_edge_cases", "config::int::test::test_zigzag_decode", "config::int::test::test_zigzag_encode", "bytes", "char_serialization", "deserializing_errors", "endian_difference", "encode_box", "not_human_readable", "path_buf", "serde_bytes", "test_basic_struct", "test...
[]
[]
39
2020-05-26T19:40:05Z
bincode-org/bincode
336
bincode-org__bincode-336
[ "335" ]
f5fa06e761646ba083c1317a4ba0dcd58eefe99b
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bincode" -version = "1.3.0" # remember to update html_root_url +version = "1.3.1" # remember to update html_root_url authors = ["Ty Overby <ty@pre-alpha.com>", "Francesco Mazzoli <f@mazzo.li>", "David Tolnay <dto...
diff --git a/src/de/read.rs b/src/de/read.rs --- a/src/de/read.rs +++ b/src/de/read.rs @@ -185,3 +180,23 @@ where visitor.visit_bytes(&self.temp_buffer[..]) } } + +#[cfg(test)] +mod test { + use super::IoReader; + + #[test] + fn test_fill_buffer() { + let buffer = vec![0u8; 64]; + ...
Regression in 1.3.0: memory allocation of 8391155392347897856 bytes failed Can be reproduced by adding the following test to the bottom of src/lib.rs in https://github.com/sharkdp/bat/tree/b09d245dea7e2f45cf461fda978f3256e7162465 and running `cargo update` and `cargo test --lib bincode_repro`. It succeeds with bincode ...
The regression seems to start with https://github.com/servo/bincode/pull/309. I'm uncertain, but it seems like [`fill_buffer`](https://github.com/servo/bincode/blob/f5fa06e761646ba083c1317a4ba0dcd58eefe99b/src/de/read.rs#L143-L154) was written to assume that it will only add at most `length` bytes to the buffer. Howev...
2020-06-24T13:33:27
1.3
f5fa06e761646ba083c1317a4ba0dcd58eefe99b
[ "de::read::test::test_fill_buffer" ]
[ "config::int::test::test_zigzag_decode", "config::int::test::test_zigzag_edge_cases", "config::int::test::test_zigzag_encode", "char_serialization", "bytes", "deserializing_errors", "endian_difference", "path_buf", "encode_box", "not_human_readable", "serde_bytes", "test_basic_struct", "test...
[]
[]
40
2020-06-24T06:42:46Z
boa-dev/boa
245
boa-dev__boa-245
[ "204" ]
448835295a1cb2cbb216c0459759f208e132606c
diff --git a/src/lib/syntax/lexer.rs b/src/lib/syntax/lexer.rs --- a/src/lib/syntax/lexer.rs +++ b/src/lib/syntax/lexer.rs @@ -426,11 +426,25 @@ impl<'a> Lexer<'a> { None => break, }; - if !c.is_digit(10) { - ...
diff --git a/src/lib/syntax/lexer.rs b/src/lib/syntax/lexer.rs --- a/src/lib/syntax/lexer.rs +++ b/src/lib/syntax/lexer.rs @@ -1002,7 +1016,9 @@ mod tests { #[test] fn numbers() { - let mut lexer = Lexer::new("1 2 0x34 056 7.89 42. 5e3 5e+3 5e-3 0b10 0O123 0999"); + let mut lexer = Lexer::new(...
Number(<float>e<int>) should work It looks like scientific notation numbers starting with a float compile to either `undefined` (positive float base) and when used in Number() triggers a panic. For example: ```js Number(1e1) // Works Number(-1e1) // Works Number(1e-1) // Works Number(-1e-1) // Works Number(1...
I ran into this while trying to fix some panics in the lexer. It looks like the lexer is trying to lex the number as two separate ones. The above panic will no longer occur, but the parser throws an error. I'm going to try fixing this
2020-02-05T11:36:17
0.5
cb850fc13e94e1baec09267bd010a4cd4565d73d
[ "syntax::lexer::tests::numbers" ]
[ "builtins::array::tests::concat", "builtins::array::tests::find", "builtins::array::tests::push", "builtins::array::tests::reverse", "builtins::array::tests::join", "builtins::array::tests::pop", "builtins::boolean::tests::check_boolean_constructor_is_function", "builtins::array::tests::find_index", ...
[]
[]
41
2020-02-10T23:52:51Z
boa-dev/boa
235
boa-dev__boa-235
[ "224" ]
6947122815f33b57b51062720380ca9ae68b47ad
diff --git a/src/lib/syntax/lexer.rs b/src/lib/syntax/lexer.rs --- a/src/lib/syntax/lexer.rs +++ b/src/lib/syntax/lexer.rs @@ -171,6 +171,20 @@ impl<'a> Lexer<'a> { fn preview_next(&mut self) -> Option<char> { self.buffer.peek().copied() } + /// Preview a char x indexes further in buf, without inc...
diff --git a/src/lib/syntax/lexer.rs b/src/lib/syntax/lexer.rs --- a/src/lib/syntax/lexer.rs +++ b/src/lib/syntax/lexer.rs @@ -1026,4 +1051,61 @@ mod tests { TokenData::RegularExpressionLiteral("\\/[^\\/]*\\/*".to_string(), "gmi".to_string()) ); } + + #[test] + fn test_addition_no_space...
Simple assignement with Number+"+" or Number+"-" does not work Simple assignement with addition does not work when there is no space between first operand and "+" or "-": ``` let a = 1+ 2; ``` This works though: ``` let a = 1 + 2; ``` Same with "-" binary operator. ``` thread 'main' panicked at 'Could ...
This is coming from here https://github.com/jasonwilliams/boa/blob/master/src/lib/syntax/lexer.rs#L430 It seems like once you add a space, the `+` is pushed to `buf`, so we make a call to the `f64::from_str` with `1+`. I'll have a look, I wanted to get started contributing to boa since the talk at JSConf EU so that...
2020-01-25T19:56:58
0.5
cb850fc13e94e1baec09267bd010a4cd4565d73d
[ "syntax::lexer::tests::test_addition_no_spaces", "syntax::lexer::tests::test_addition_no_spaces_e_number", "syntax::lexer::tests::test_addition_no_spaces_e_number_left_side", "syntax::lexer::tests::test_addition_no_spaces_left_side" ]
[ "builtins::array::tests::concat", "builtins::array::tests::join", "builtins::array::tests::find", "builtins::array::tests::reverse", "builtins::array::tests::pop", "builtins::array::tests::push", "builtins::array::tests::find_index", "builtins::array::tests::inclues_value", "builtins::boolean::tests...
[]
[]
42
2020-02-04T21:25:27Z
boa-dev/boa
58
boa-dev__boa-58
[ "45" ]
bf9b78954a7763411ecb3c3586e3e973bbcf062b
diff --git a/src/lib/syntax/parser.rs b/src/lib/syntax/parser.rs --- a/src/lib/syntax/parser.rs +++ b/src/lib/syntax/parser.rs @@ -407,41 +407,40 @@ impl Parser { } } TokenData::Punctuator(Punctuator::OpenBracket) => { - let mut array: Vec<Expr> = Vec::new(); - ...
diff --git a/src/lib/syntax/parser.rs b/src/lib/syntax/parser.rs --- a/src/lib/syntax/parser.rs +++ b/src/lib/syntax/parser.rs @@ -810,9 +809,12 @@ mod tests { check_parser("[]", &[Expr::new(ExprDef::ArrayDeclExpr(vec![]))]); // Check array with empty slot - // FIXME: This does not work, it s...
Trailing commas in array assignments make the parser fail ### Specification Link https://tc39.es/ecma262/#prod-ArrayAssignmentPattern ### Example JS ```js let foo = [1, 2, 3,]; ``` ### Expected Parser should ignore the trailing comma ### Related to https://github.com/jasonwilliams/boa/pull/42/files#diff...
2019-07-07T18:04:53
0.2
71340e6becc85fb660d9017fd8a21f035a6d39d7
[ "syntax::parser::tests::check_array" ]
[ "js::value::tests::check_get_set_field", "js::value::tests::check_integer_is_true", "js::value::tests::check_is_object", "js::value::tests::check_number_is_true", "js::value::tests::check_string_to_value", "js::string::tests::check_string_constructor_is_function", "js::value::tests::check_undefined", ...
[]
[]
44
2019-07-09T09:19:35Z
boa-dev/boa
3,508
boa-dev__boa-3508
[ "1848" ]
279caabf796ae22322d91dd0f79f63c53e99007f
diff --git a/core/engine/src/builtins/function/mod.rs b/core/engine/src/builtins/function/mod.rs --- a/core/engine/src/builtins/function/mod.rs +++ b/core/engine/src/builtins/function/mod.rs @@ -142,7 +142,7 @@ pub enum ClassFieldDefinition { } unsafe impl Trace for ClassFieldDefinition { - custom_trace! {this, ...
diff --git a/core/engine/src/vm/tests.rs b/core/engine/src/vm/tests.rs --- a/core/engine/src/vm/tests.rs +++ b/core/engine/src/vm/tests.rs @@ -417,3 +417,17 @@ fn cross_context_funtion_call() { assert_eq!(result, Ok(JsValue::new(100))); } + +// See: https://github.com/boa-dev/boa/issues/1848 +#[test] +fn long_o...
Long reference "chain" can overflow the stack during GC trace Very long "reference chains" (i.e. very deeply nested objects) can overflow the stack because, afaict, each object trace during GC cycles is its own function call. It seems like there's basically no guards against stack overflows (for example even simple ca...
I think I'll try to tackle this, if no one is working on this :)
2023-12-06T22:53:53
0.17
279caabf796ae22322d91dd0f79f63c53e99007f
[ "test::weak::eph_self_referential_chain", "test::weak::eph_self_referential" ]
[ "core/engine/src/bigint.rs - bigint::JsBigInt::mod_floor (line 213)", "core/engine/src/error.rs - error::JsError (line 32)", "core/engine/src/context/mod.rs - context::Context::register_global_property (line 212)", "core/engine/src/native_function.rs - native_function::NativeFunction::from_async_fn (line 163)...
[ "core/engine/src/context/mod.rs - context::Context (line 54)", "core/engine/src/context/hooks.rs - context::hooks::HostHooks (line 22)", "core/engine/src/class.rs - class (line 7)", "core/engine/src/context/mod.rs - context::Context::eval (line 172)", "core/engine/src/lib.rs - (line 11)", "core/engine/src...
[]
45
2023-12-07T09:29:29Z
amethyst/bracket-lib
240
amethyst__bracket-lib-240
[ "230" ]
f6d1e87e44d57e3b6f2f558bfadad9000cc10f28
diff --git a/bracket-geometry/src/rect.rs b/bracket-geometry/src/rect.rs --- a/bracket-geometry/src/rect.rs +++ b/bracket-geometry/src/rect.rs @@ -82,8 +82,8 @@ impl Rect { where F: FnMut(Point), { - for y in self.y1..=self.y2 { - for x in self.x1..=self.x2 { + for y in self....
diff --git a/bracket-geometry/src/rect.rs b/bracket-geometry/src/rect.rs --- a/bracket-geometry/src/rect.rs +++ b/bracket-geometry/src/rect.rs @@ -185,8 +185,8 @@ mod tests { points.insert(p); }); assert!(points.contains(&Point::new(0, 0))); - assert!(points.contains(&Point::new(1,...
Rect::for_each is inclusive, vs. other functions exclusive `Rect::for_each` iterates inclusively to (x2, y2), which disagrees with the convention used by all other Rect functions. It looks like the exclusive convention was decided on in 223148ea11ada7af45204cd35b8d0f6f8463dee1, but the `for_each` function was left as i...
I just came here to report the same thing. Note that `test_rect_set()` and `test_rect_callback()` actually explicitly test that `Rect::with_size(0, 0, 1, 1)` has one point when accessed with `Rect::point_set` but four points when accessed with `Rect::for_each`; I assume the test is wrong.
2021-11-03T22:13:50
0.8
cf8eec60ae17f2534a14f3ae643c871202aed192
[ "rect::tests::test_rect_callback" ]
[ "circle_bresenham::tests::circle_test_radius1", "angles::tests::test_project_angle", "circle_bresenham::tests::circle_nodiag_test_radius3", "distance::tests::test_algorithm_from_shared_reference", "distance::tests::test_manhattan_distance", "circle_bresenham::tests::circle_test_radius3", "distance::test...
[]
[]
46
2021-11-05T14:52:02Z
tokio-rs/bytes
560
tokio-rs__bytes-560
[ "559" ]
38fd42acbaced11ff19f0a4ca2af44a308af5063
diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs --- a/src/bytes_mut.rs +++ b/src/bytes_mut.rs @@ -670,7 +670,10 @@ impl BytesMut { // Compare the condition in the `kind == KIND_VEC` case above // for more details. - if v_capacity >= new_cap && offset >= len { + ...
diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs --- a/tests/test_bytes.rs +++ b/tests/test_bytes.rs @@ -515,6 +515,34 @@ fn reserve_in_arc_unique_doubles() { assert_eq!(2000, bytes.capacity()); } +#[test] +fn reserve_in_arc_unique_does_not_overallocate_after_split() { + let mut bytes = BytesMut::from(...
reserve_inner over allocates which can lead to a OOM conidition # Summary `reseve_inner` will double the size of the underlying shared vector instead of just extending the BytesMut buffer in place if a call to `BytesMut::reserve` would fit inside the current allocated shared buffer. If this happens repeatedly you wi...
2022-07-30T07:42:13
1.2
38fd42acbaced11ff19f0a4ca2af44a308af5063
[ "reserve_in_arc_unique_does_not_overallocate_after_split", "reserve_in_arc_unique_does_not_overallocate_after_multiple_splits" ]
[ "test_deref_buf_forwards", "test_fresh_cursor_vec", "copy_to_bytes_overflow - should panic", "test_get_u16_buffer_underflow - should panic", "test_bufs_vec", "test_get_u16", "test_get_u8", "test_vec_deque", "copy_to_bytes_less", "copy_from_slice_panics_if_different_length_1 - should panic", "tes...
[]
[]
47
2022-07-30T16:42:55Z
tokio-rs/bytes
732
tokio-rs__bytes-732
[ "730" ]
291df5acc94b82a48765e67eeb1c1a2074539e68
diff --git a/src/buf/buf_impl.rs b/src/buf/buf_impl.rs --- a/src/buf/buf_impl.rs +++ b/src/buf/buf_impl.rs @@ -66,6 +66,12 @@ macro_rules! buf_get_impl { }}; } +// https://en.wikipedia.org/wiki/Sign_extension +fn sign_extend(val: u64, nbytes: usize) -> i64 { + let shift = (8 - nbytes) * 8; + (val << shift...
diff --git a/tests/test_buf.rs b/tests/test_buf.rs --- a/tests/test_buf.rs +++ b/tests/test_buf.rs @@ -36,6 +36,19 @@ fn test_get_u16() { assert_eq!(0x5421, buf.get_u16_le()); } +#[test] +fn test_get_int() { + let mut buf = &b"\xd6zomg"[..]; + assert_eq!(-42, buf.get_int(1)); + let mut buf = &b"\xd6zom...
`Buf::get_int()` implementation for `Bytes` returns positive number instead of negative when `nbytes` < 8. **Steps to reproduce:** Run the following program, using `bytes` version 1.7.1 ``` use bytes::{BytesMut, Buf, BufMut}; fn main() { const SOME_NEG_NUMBER: i64 = -42; let mut buffer = BytesMut::wit...
It looks like this has been caused by 234d814122d6445bdfb15f635290bfc4dd36c2eb / #280, as demonstrated by the revert: <details> <summary>See the revert</summary> ```patch From 4a9b9a4ea0538dff7d9ae57070c98f6ad4afd708 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini <paolo.barbolini@m4ss.net> Date: Mon, 19 Aug 2...
2024-08-19T21:14:07
1.7
291df5acc94b82a48765e67eeb1c1a2074539e68
[ "test_get_int" ]
[ "bytes_mut::tests::test_original_capacity_to_repr", "bytes_mut::tests::test_original_capacity_from_repr", "copy_to_bytes_less", "test_bufs_vec", "copy_to_bytes_overflow - should panic", "test_deref_buf_forwards", "test_fresh_cursor_vec", "test_get_u16", "test_get_u16_buffer_underflow - should panic"...
[]
[]
48
2024-08-30T12:20:30Z
starkware-libs/cairo
4,777
starkware-libs__cairo-4777
[ "4744" ]
75f779e8553d28e4bfff3b23f140ccc781c9dab0
diff --git a/crates/cairo-lang-sierra-generator/src/store_variables/known_stack.rs b/crates/cairo-lang-sierra-generator/src/store_variables/known_stack.rs --- a/crates/cairo-lang-sierra-generator/src/store_variables/known_stack.rs +++ b/crates/cairo-lang-sierra-generator/src/store_variables/known_stack.rs @@ -70,9 +70,...
diff --git a/crates/cairo-lang-sierra-generator/src/store_variables/test.rs b/crates/cairo-lang-sierra-generator/src/store_variables/test.rs --- a/crates/cairo-lang-sierra-generator/src/store_variables/test.rs +++ b/crates/cairo-lang-sierra-generator/src/store_variables/test.rs @@ -207,6 +207,11 @@ fn get_lib_func_sign...
bug: One of the arguments does not satisfy the requirements of the libfunc. # Bug Report **Cairo version: 2.3.0-rc0** <!-- Please specify commit or tag version. --> **Current behavior:** ```cairo fn g(ref v: Felt252Vec<u64>, a: usize, b: usize, c: usize, d: usize, x: u64, y: u64) { let mut v_a = v[a];...
I suggested a temporary workaround as you suggested to me last time @orizi, which is ```rust #[inline(never)] fn no_op() {} fn g(ref v: Felt252Vec<u64>, a: usize, b: usize, c: usize, d: usize, x: u64, y: u64) { let mut v_a = v[a]; let mut v_b = v[b]; let mut v_c = v[c]; let mut v_d = v[d];...
2024-01-10T17:30:48
2.4
75f779e8553d28e4bfff3b23f140ccc781c9dab0
[ "store_variables::test::push_values_with_hole" ]
[ "canonical_id_replacer::test::test_replacer", "function_generator::test::function_generator::simple", "function_generator::test::function_generator::literals", "function_generator::test::function_generator::match_", "function_generator::test::function_generator::inline", "block_generator::test::block_gene...
[]
[]
50
2024-01-15T08:20:26Z
tafia/calamine
402
tafia__calamine-402
[ "401" ]
7aa2086f7f1e9ddd06dd83acf24c2e9b29218b75
diff --git a/src/xlsx/mod.rs b/src/xlsx/mod.rs --- a/src/xlsx/mod.rs +++ b/src/xlsx/mod.rs @@ -459,6 +459,7 @@ impl<RS: Read + Seek> Xlsx<RS> { // sheets must be added before this is called!! fn read_table_metadata(&mut self) -> Result<(), XlsxError> { + let mut new_tables = Vec::new(); for ...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -1674,3 +1674,14 @@ fn issue_384_multiple_formula() { ]; assert_eq!(formula, expected) } + +#[test] +fn issue_401_empty_tables() { + setup(); + + let path = format!("{}/tests/date.xlsx", env!("CARGO_MANIFEST_DIR")); +...
Isssue with load_tables and table_names functions Please, help me! When I try to parse xlsx file with smart table inside, functions load_table and table_names work good. But when I try to parse xlsx file without smart table inside the same code failed with error "Tables must be loaded before they are referenced" ...
This is a legit bug. I have a fix but I need to get a file to test on.
2024-02-08T20:33:23
0.23
7aa2086f7f1e9ddd06dd83acf24c2e9b29218b75
[ "issue_401_empty_tables" ]
[ "datatype::date_tests::test_dates", "datatype::date_tests::test_int_dates", "datatype::tests::test_as_f64_with_bools", "datatype::tests::test_as_i64_with_bools", "datatype::tests::test_partial_eq", "de::tests::test_deserialize_enum", "formats::test_is_date_format", "utils::tests::sound_to_u32", "xls...
[]
[]
52
2024-02-08T12:41:47Z
RustScan/RustScan
660
RustScan__RustScan-660
[ "651" ]
c3d24feebef4c605535a6661ddfeaa18b9bde60c
diff --git a/src/address.rs b/src/address.rs --- a/src/address.rs +++ b/src/address.rs @@ -1,4 +1,5 @@ //! Provides functions to parse input IP addresses, CIDRs or files. +use std::collections::BTreeSet; use std::fs::{self, File}; use std::io::{prelude::*, BufReader}; use std::net::{IpAddr, SocketAddr, ToSocketAddr...
diff --git a/src/address.rs b/src/address.rs --- a/src/address.rs +++ b/src/address.rs @@ -256,6 +262,16 @@ mod tests { assert_eq!(ips.len(), 0); } + #[test] + fn parse_duplicate_cidrs() { + let mut opts = Opts::default(); + opts.addresses = vec!["79.98.104.0/21".to_owned(), "79.98.1...
Dublication of ports in output rustscan.exe -a tmp/asns_prefixes_specific.txt -p 80,443,8443,8080,8006 --scripts none <img width="365" alt="Screenshot_2" src="https://github.com/user-attachments/assets/ef874b42-60b5-4260-bc67-dd7abe6dbfce"> tmp/asns_prefixes_specific.txt `185.52.205.0/24 79.98.109.0/24 185.239....
I suspect that when we got 79.98.104.0/21 79.98.104.0/24 dublication comes from this
2024-09-19T00:46:28
2.3
c3d24feebef4c605535a6661ddfeaa18b9bde60c
[ "address::tests::parse_duplicate_cidrs" ]
[ "address::tests::parse_correct_addresses", "address::tests::parse_empty_hosts_file", "address::tests::parse_naughty_host_file", "input::tests::opts_merge_required_arguments", "input::tests::opts_no_merge_when_config_is_ignored", "input::tests::opts_merge_optional_arguments", "input::tests::parse_trailin...
[]
[]
53
2024-09-21T18:08:33Z
RustScan/RustScan
518
RustScan__RustScan-518
[ "515" ]
7dd9352baee3b467b4c55c95edf4de8494ca8a40
diff --git a/src/port_strategy/mod.rs b/src/port_strategy/mod.rs --- a/src/port_strategy/mod.rs +++ b/src/port_strategy/mod.rs @@ -67,7 +67,7 @@ pub struct SerialRange { impl RangeOrder for SerialRange { fn generate(&self) -> Vec<u16> { - (self.start..self.end).collect() + (self.start..=self.end)....
diff --git a/src/port_strategy/mod.rs b/src/port_strategy/mod.rs --- a/src/port_strategy/mod.rs +++ b/src/port_strategy/mod.rs @@ -104,7 +104,7 @@ mod tests { let range = PortRange { start: 1, end: 100 }; let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Serial); let result = s...
--range <start-end>, only contain start, But not end port In nmap run:**nmap 192.168.1.2 -p 1-65535** ,nmap scan port range is 1-65535. But in RustScan run:**rustscan 192.168.1.2 --range 1-65535** (or directly execute **rustscan 192.168.1.2**) by wireshark verification, the scan range is 1-65534, does not contain 6553...
2023-05-26T04:18:08
2.1
2ab7191a659e4e431098d530b6376c753b8616dd
[ "port_strategy::tests::serial_strategy_with_range", "port_strategy::tests::random_strategy_with_range", "port_strategy::range_iterator::tests::range_iterator_iterates_through_the_entire_range" ]
[ "input::tests::opts_merge_optional_arguments", "input::tests::opts_no_merge_when_config_is_ignored", "input::tests::opts_merge_required_arguments", "port_strategy::tests::serial_strategy_with_ports", "port_strategy::tests::random_strategy_with_ports", "scanner::socket_iterator::tests::goes_through_every_i...
[]
[]
54
2024-04-07T07:10:45Z
clockworklabs/SpacetimeDB
1,894
clockworklabs__SpacetimeDB-1894
[ "1818" ]
9c64d1fbd17e99bbb8db1479492d88ba7578acc9
diff --git a/crates/bindings-macro/src/lib.rs b/crates/bindings-macro/src/lib.rs --- a/crates/bindings-macro/src/lib.rs +++ b/crates/bindings-macro/src/lib.rs @@ -45,6 +45,7 @@ mod sym { symbol!(public); symbol!(sats); symbol!(scheduled); + symbol!(scheduled_at); symbol!(unique); symbol!(upd...
diff --git a/crates/bindings/tests/ui/reducers.rs b/crates/bindings/tests/ui/reducers.rs --- a/crates/bindings/tests/ui/reducers.rs +++ b/crates/bindings/tests/ui/reducers.rs @@ -25,8 +25,22 @@ fn missing_ctx(_a: u8) {} #[spacetimedb::reducer] fn ctx_by_val(_ctx: ReducerContext, _a: u8) {} +#[spacetimedb::table(nam...
`#[spacetimedb::table(scheduled())]` should probably not autogen the scheduled_id/at fields for you - should just require they already be present UX story: > Someone new comes to the codebase and wants to insert a row into the table. the compiler complains "missing fields scheduled_id and schedule_at" and so they go t...
2024-10-24T02:23:38
1.78
8075567da42408ecf53146fb3f72832e41d8a956
[ "ui" ]
[ "deptree_snapshot", "tests/ui/tables.rs", "crates/bindings/src/rng.rs - rng::ReducerContext::rng (line 30)" ]
[]
[]
55
2025-02-11T02:53:30Z
JohnnyMorganz/StyLua
422
JohnnyMorganz__StyLua-422
[ "421" ]
30c713bc68d31b45fcfba1227bc6fbd4df97cba2
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed issue through static linking where Windows binary would not execute due to missing `VCRUNTIME140.dll`. ([#413](https://git...
diff --git a/tests/test_ignore.rs b/tests/test_ignore.rs --- a/tests/test_ignore.rs +++ b/tests/test_ignore.rs @@ -211,3 +211,48 @@ local bar = baz local bar = baz "###); } + +#[test] +fn test_multiline_block_ignore_multiple_comments_in_leading_trivia() { + insta::assert_snapshot!( + format( ...
Block ignore is not applied to all back-to-back blocks When `--stylua: ignore start/end` comments are applied back-to-back, they take effect on every second ignored block. This might be considered as a non-issue because they can be merged into one single ignored block, but it might be inconvenient when they are separat...
Yeah, this is a bug - it seems as though we are not correctly re-opening an ignore section when we see the `--stylua: ignore start` comment. This code is actually parsed as these separate statements: ```lua --stylua: ignore start local a = 1 --------------------------- --stylua: ignore end --stylua: igno...
2022-03-27T21:08:32
0.12
a369d02342f3b1432ff89c619c97129a57678141
[ "test_multiline_block_ignore_multiple_comments_in_leading_trivia" ]
[ "formatters::trivia_util::tests::test_token_contains_no_singleline_comments_2", "formatters::trivia_util::tests::test_token_contains_no_singleline_comments", "formatters::trivia_util::tests::test_token_contains_singleline_comments", "tests::test_config_call_parentheses", "tests::test_config_column_width", ...
[]
[]
56
2022-03-27T13:12:43Z
JohnnyMorganz/StyLua
931
JohnnyMorganz__StyLua-931
[ "928" ]
d67c77b6f73ccab63d544adffe9cf3d859e71fa4
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixed regression where configuration present in current working directory not used when formatting from st...
diff --git a/src/cli/main.rs b/src/cli/main.rs --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -810,6 +810,24 @@ mod tests { cwd.close().unwrap(); } + #[test] + fn test_cwd_configuration_respected_when_formatting_from_stdin() { + let cwd = construct_tree!({ + "stylua.toml": "quote...
after new release stdin does not repsect .stylua.toml by default unless must set config-path .. before no need ![image](https://github.com/user-attachments/assets/22c7f2c4-60d4-478c-bc21-cd0593252d23)
Looks like a mistake in https://github.com/JohnnyMorganz/StyLua/blob/1daf4c18fb6baf687cc41082f1cc6905ced226a4/src/cli/config.rs#L96, we forget to check the current directory if stdin file path was not provided. Thanks for reporting! As a work around, you can use `--stdin-filepath` to specify the file path for the file...
2024-11-30T20:21:18
2.0
f581279895a7040a36abaea4a6c8a6f50f112cd7
[ "tests::test_cwd_configuration_respected_when_formatting_from_stdin" ]
[ "editorconfig::tests::test_call_parentheses_always", "editorconfig::tests::test_call_parentheses_no_single_string", "editorconfig::tests::test_call_parentheses_no_single_table", "editorconfig::tests::test_call_parentheses_none", "editorconfig::tests::test_collapse_simple_statement_always", "editorconfig::...
[]
[]
57
2024-11-30T12:36:13Z
JohnnyMorganz/StyLua
926
JohnnyMorganz__StyLua-926
[ "925" ]
08e536f3a02d9a07b0991726897e0013ff78dd21
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixed CLI overrides not applying on top of a resolved `stylua.toml` file ([#925](https://github.com/Johnny...
diff --git a/src/cli/main.rs b/src/cli/main.rs --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -953,4 +950,74 @@ mod tests { cwd.close().unwrap(); } + + #[test] + fn test_uses_cli_overrides_instead_of_default_configuration() { + let cwd = construct_tree!({ + "foo.lua": "local x = ...
CLI overrides not applied when formatting files in v2.0.0 I tried to run it both from Windows and from Docker for Windows `stylua.exe --line-endings Windows --check .` `stylua.exe --line-endings Unix --check .` The result is the same, it gives errors in all files. Example of the first two files ``` Diff i...
Hm, this does look like line endings changing for some reason. Which is weird, since I don't think we touched that at all. Do you by any chance have an example file I can test this with? Either in a public repo, or attaching a code file here (not in a code block since we need to preserve the line endings) Yes, sure ...
2024-11-18T05:01:53
2.0
f581279895a7040a36abaea4a6c8a6f50f112cd7
[ "tests::test_uses_cli_overrides_instead_of_found_configuration" ]
[ "editorconfig::tests::test_call_parentheses_no_single_table", "editorconfig::tests::test_call_parentheses_always", "editorconfig::tests::test_call_parentheses_no_single_string", "editorconfig::tests::test_call_parentheses_none", "editorconfig::tests::test_collapse_simple_statement_function_only", "editorc...
[]
[]
58
2024-11-17T21:06:05Z
JohnnyMorganz/StyLua
916
JohnnyMorganz__StyLua-916
[ "831", "915" ]
d7d532b4baf2bcf2adf1925d7248f659788e5b58
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -229,7 +229,8 @@ StyLua has opinionated defaults, but also provides a few options that can be set ### Finding the configuration -The CLI looks for `stylua.toml` or `.stylua.toml` in the directory where the tool was executed. +The CLI looks for a...
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update internal Lua parser version (full-moon) to v1.1.0. This includes parser performance improvements. ([#854](https://github.com/Johnn...
feat: Use closest `stylua.toml` config to file being formatted It would be nice if the formatter can be configured to stop looking for config files when reached a Git root (e.g. `git rev-parse --show-toplevel`) this will be useful such that when inside a lua repo and inside submodule, we stop at first `.stylelua` file,...
> we stop at first .stylelua file, somehow it does not stop and merges this sounds incorrect to me, we don't merge two stylua files together. That sounds like the underlying issue here, rather than adding something else to stop at git roots. Ah maybe you start the discovery of the style file from the current workin...
2024-11-17T19:57:54
0.20
26047670e05ba310afe9c1c1f91be6749e1f3ac9
[ "tests::test_stdin_filepath_respects_cwd_configuration_for_nested_file", "tests::test_configuration_is_searched_next_to_file", "tests::test_configuration_is_used_closest_to_the_file" ]
[ "editorconfig::tests::test_call_parentheses_no_single_string", "editorconfig::tests::test_call_parentheses_always", "editorconfig::tests::test_call_parentheses_no_single_table", "editorconfig::tests::test_call_parentheses_none", "editorconfig::tests::test_collapse_simple_statement_always", "editorconfig::...
[]
[]
59
2024-11-17T16:13:53Z
JohnnyMorganz/StyLua
852
JohnnyMorganz__StyLua-852
[ "845" ]
bc3ce881eaaee46e8eb851366d33cba808d2a1f7
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The CLI tool will now only write files if the contents differ, and not modify if no change ([#827](https://github.com/JohnnyMorganz/StyLua/...
diff --git a/src/cli/main.rs b/src/cli/main.rs --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -769,4 +769,21 @@ mod tests { cwd.close().unwrap(); } + + #[test] + fn test_respect_ignores_directory_no_glob() { + // https://github.com/JohnnyMorganz/StyLua/issues/845 + let cwd = construc...
`--respect-ignores`: does not correctly ignore folders without the globbing pattern Problem: `.styluaignore` does not ignore **folders** or **directories** like `.gitignore`, `.rgignore`, etc. do. Instead, full globbing patterns (`*.lua` or `**/*.lua`) would be needed to ignore all files under a directory. EDIT: Th...
We use the ignore crate to provide gitignore-style ignores: https://docs.rs/ignore/latest/ignore/. This may actually be an issue upstream, but I will verify it myself first (Ignore my previous response - I did not read your issue properly!) Yes, I find that ignoring a (sub)directory works when scanning, i.e., "stylua ...
2024-01-20T20:13:59
0.19
bc3ce881eaaee46e8eb851366d33cba808d2a1f7
[ "tests::test_respect_ignores_directory_no_glob" ]
[ "editorconfig::tests::test_call_parentheses_none", "editorconfig::tests::test_call_parentheses_always", "editorconfig::tests::test_call_parentheses_no_single_table", "editorconfig::tests::test_call_parentheses_no_single_string", "editorconfig::tests::test_collapse_simple_statement_conditional_only", "edit...
[]
[]
60
2024-01-20T12:37:21Z
gfx-rs/naga
1,611
gfx-rs__naga-1611
[ "1545" ]
33c1daeceef9268a9502df0720d69c9aa9b464da
diff --git a/src/front/wgsl/mod.rs b/src/front/wgsl/mod.rs --- a/src/front/wgsl/mod.rs +++ b/src/front/wgsl/mod.rs @@ -3470,9 +3470,20 @@ impl Parser { lexer.expect(Token::Paren(')'))?; let accept = self.parse_block(lexer, context.reborrow(), false)?; + ...
diff --git a/src/front/wgsl/tests.rs b/src/front/wgsl/tests.rs --- a/src/front/wgsl/tests.rs +++ b/src/front/wgsl/tests.rs @@ -215,7 +215,7 @@ fn parse_if() { if (0 != 1) {} if (false) { return; - } elseif (true) { + } else if (true) { re...
The else if statement is not supported Naga does not allow an if_statement inside an else_statement, but the [spec](https://www.w3.org/TR/WGSL/#if-statement) allows for it. ``` if (true) {} else if (false) {} ``` ``` Parse Error: expected '{', found 'if' ```
2021-12-17T23:11:03
0.7
33c1daeceef9268a9502df0720d69c9aa9b464da
[ "front::wgsl::tests::parse_if" ]
[ "arena::tests::fetch_or_append_non_unique", "arena::tests::append_unique", "arena::tests::append_non_unique", "back::spv::layout::test_physical_layout_in_words", "back::msl::test_error_size", "arena::tests::fetch_or_append_unique", "back::spv::writer::test_write_physical_layout", "back::spv::layout::t...
[ "back::msl::writer::test_stack_size" ]
[]
61
2021-12-17T16:19:39Z
gfx-rs/naga
1,139
gfx-rs__naga-1139
[ "1138" ]
e97c8f944121a58bbc908ecb64bdf97d4ada039d
diff --git a/src/proc/mod.rs b/src/proc/mod.rs --- a/src/proc/mod.rs +++ b/src/proc/mod.rs @@ -101,11 +101,15 @@ impl super::TypeInner { kind: _, width, } => (size as u8 * width) as u32, + // matrices are treated as arrays of aligned columns Self::M...
diff --git a/src/proc/mod.rs b/src/proc/mod.rs --- a/src/proc/mod.rs +++ b/src/proc/mod.rs @@ -318,3 +322,17 @@ impl super::SwizzleComponent { } } } + +#[test] +fn test_matrix_size() { + let constants = crate::Arena::new(); + assert_eq!( + crate::TypeInner::Matrix { + columns: cra...
[wgsl-in] Size of nx3 matrices is not to spec, resulting in overlapping fields This struct declaration: ``` struct Foo { m: mat3x3<f32>; f: f32; }; ``` Produces this spir-v: ``` ; SPIR-V ; Version: 1.0 ; Generator: Khronos; 28 ; Bound: 7 ; Schema: 0 OpCapability Shader ...
2021-07-26T22:37:50
0.5
c39810233274b0973fe0fcbfedb3ced8c9f685b6
[ "proc::test_matrix_size" ]
[ "arena::tests::append_non_unique", "arena::tests::append_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "arena::tests::fetch_or_append_non_unique", "back::spv::layout::test_logical_layout_in_words", "back::spv::layout::test_physical_layout_in_words", "front::glsl::const...
[ "back::msl::writer::test_stack_size" ]
[]
62
2021-07-26T14:40:50Z
gfx-rs/naga
1,006
gfx-rs__naga-1006
[ "1003" ]
3a4d6fa29584228e206ecb1d0eeac6dd565cdb1c
diff --git a/src/front/glsl/ast.rs b/src/front/glsl/ast.rs --- a/src/front/glsl/ast.rs +++ b/src/front/glsl/ast.rs @@ -955,6 +955,7 @@ pub enum TypeQualifier { WorkGroupSize(usize, u32), Sampling(Sampling), Layout(StructLayout), + Precision(Precision), EarlyFragmentTests, } diff --git a/src/fr...
diff --git a/src/front/glsl/parser_tests.rs b/src/front/glsl/parser_tests.rs --- a/src/front/glsl/parser_tests.rs +++ b/src/front/glsl/parser_tests.rs @@ -246,6 +246,15 @@ fn declarations() { &entry_points, ) .unwrap(); + + let _program = parse_program( + r#" + #version 450 + ...
[glsl-in] precision statement is not parsed As a statement, `precision highp float;` shouldn't cause an error.
2021-06-22T04:33:55
0.5
c39810233274b0973fe0fcbfedb3ced8c9f685b6
[ "front::glsl::parser_tests::declarations" ]
[ "arena::tests::append_non_unique", "arena::tests::append_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "back::spv::layout::test_physical_layout_in_words", "back::spv::writer::test_write_physical_layout", "back::spv::layout::t...
[ "back::msl::writer::test_stack_size" ]
[]
63
2021-06-21T20:37:09Z
gfx-rs/naga
933
gfx-rs__naga-933
[ "931" ]
61bfb29963fba9a7e8807bdd7ca1c5e5a8b76fec
diff --git a/src/front/glsl/ast.rs b/src/front/glsl/ast.rs --- a/src/front/glsl/ast.rs +++ b/src/front/glsl/ast.rs @@ -12,11 +12,17 @@ use crate::{ }; #[derive(Debug, Clone, Copy)] -pub enum GlobalLookup { +pub enum GlobalLookupKind { Variable(Handle<GlobalVariable>), BlockSelect(Handle<GlobalVariable>, u...
diff --git a/tests/snapshots.rs b/tests/snapshots.rs --- a/tests/snapshots.rs +++ b/tests/snapshots.rs @@ -348,15 +348,13 @@ fn convert_spv_shadow() { } #[cfg(feature = "glsl-in")] -// TODO: Reenable tests later -#[allow(dead_code)] fn convert_glsl( name: &str, entry_points: naga::FastHashMap<String, nag...
[glsl-in] expression already in scope with constant above function ```glsl #version 450 const int constant = 10; float function() { return 0.0; } ``` fails to validate with the following error: ``` Function [1] 'function' is invalid: Expression [1] can't be introduced - it's already in scope ``` Ch...
Thank you for your report, this is an issue with emitting that I have already fixed in my local fork and will make a PR soon
2021-06-02T02:31:43
0.4
575304a50c102f2e2a3a622b4be567c0ccf6e6c0
[ "convert_glsl_quad" ]
[ "arena::tests::append_non_unique", "arena::tests::append_unique", "back::msl::test_error_size", "arena::tests::fetch_or_append_non_unique", "arena::tests::fetch_or_append_unique", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[ "back::msl::writer::test_stack_size" ]
[]
65
2021-07-05T11:13:04Z
gfx-rs/naga
898
gfx-rs__naga-898
[ "887" ]
99fbb34bd6b07ca0a0cc2cf01c151d8264789965
diff --git a/src/front/glsl/ast.rs b/src/front/glsl/ast.rs --- a/src/front/glsl/ast.rs +++ b/src/front/glsl/ast.rs @@ -25,7 +25,7 @@ pub struct FunctionSignature { #[derive(Debug, Clone)] pub struct FunctionDeclaration { - pub parameters: Vec<ParameterQualifier>, + pub qualifiers: Vec<ParameterQualifier>, ...
diff --git a/src/front/glsl/parser_tests.rs b/src/front/glsl/parser_tests.rs --- a/src/front/glsl/parser_tests.rs +++ b/src/front/glsl/parser_tests.rs @@ -369,6 +369,22 @@ fn functions() { &entry_points, ) .unwrap(); + + parse_program( + r#" + # version 450 + void fun(vec2 in...
[glsl-in] Builtin global have empty storage access ```glsl #version 450 void main() { gl_Position = vec4(1.0, 1.0, 1,0, 1.0); } ``` ```bash Global variable [1] 'gl_Position' is invalid: Storage access LOAD | STORE exceeds the allowed (empty) thread 'main' panicked at 'called `Option::unwrap()`...
2021-05-23T03:41:52
0.4
575304a50c102f2e2a3a622b4be567c0ccf6e6c0
[ "front::glsl::parser_tests::functions" ]
[ "arena::tests::append_unique", "arena::tests::fetch_or_append_unique", "arena::tests::append_non_unique", "back::msl::test_error_size", "arena::tests::fetch_or_append_non_unique", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[ "back::msl::writer::test_stack_size" ]
[]
66
2021-07-05T11:13:04Z
gfx-rs/naga
2,510
gfx-rs__naga-2510
[ "2412", "2234" ]
3bcb114adbf144544cb46497b000adf3e7e71181
diff --git a/src/back/glsl/mod.rs b/src/back/glsl/mod.rs --- a/src/back/glsl/mod.rs +++ b/src/back/glsl/mod.rs @@ -1129,7 +1129,8 @@ impl<'a, W: Write> Writer<'a, W> { let ty_name = &self.names[&NameKey::Type(global.ty)]; let block_name = format!( "{}_block_{}{:?}", - ty_name, ...
diff --git a/src/proc/namer.rs b/src/proc/namer.rs --- a/src/proc/namer.rs +++ b/src/proc/namer.rs @@ -268,4 +276,6 @@ fn test() { assert_eq!(namer.call("x"), "x"); assert_eq!(namer.call("x"), "x_1"); assert_eq!(namer.call("x1"), "x1_"); + assert_eq!(namer.call("__x"), "_x"); + assert_eq!(namer.cal...
[glsl-out] Rename identifiers containing two consecutive underscores since they are reserved > In addition, all identifiers containing two consecutive underscores (__) are reserved for use by underlying software layers. Defining such a name in a shader does not itself result in an error, but may result in unintended be...
## first underscore when type name is ends with number, it put the underscore ![image](https://user-images.githubusercontent.com/25075465/215984916-303369c3-0962-4488-a570-6da0197e262c.png) ## last underscore in code: in naga\src\back\glsl\mod.rs, write_interface_block function, as follow: ![image](htt...
2023-09-26T17:57:14
0.13
a17a93ef8f6a06ed8dfc3145276663786828df03
[ "proc::namer::test" ]
[ "arena::tests::append_non_unique", "arena::tests::append_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[]
[]
67
2023-09-26T14:46:03Z
gfx-rs/naga
2,440
gfx-rs__naga-2440
[ "2439" ]
7a19f3af909202c7eafd36633b5584bfbb353ecb
diff --git a/src/front/wgsl/lower/mod.rs b/src/front/wgsl/lower/mod.rs --- a/src/front/wgsl/lower/mod.rs +++ b/src/front/wgsl/lower/mod.rs @@ -504,13 +504,25 @@ impl<'source, 'temp, 'out> ExpressionContext<'source, 'temp, 'out> { } /// Insert splats, if needed by the non-'*' operations. + /// + /// Se...
diff --git a/src/front/wgsl/tests.rs b/src/front/wgsl/tests.rs --- a/src/front/wgsl/tests.rs +++ b/src/front/wgsl/tests.rs @@ -387,6 +387,54 @@ fn parse_expressions() { }").unwrap(); } +#[test] +fn binary_expression_mixed_scalar_and_vector_operands() { + for (operand, expect_splat) in [ + ('<', false)...
[wgsl-in] Comparing scalar with vector type incorrectly passes validation Spec says both sides of the comparision need to have the same type. https://www.w3.org/TR/WGSL/#comparison-expr The following snippet should therefore not pass validation. ``` const some_vec = vec3<f32>(1.0, 1.0, 1.0); @fragment fn main...
2023-08-16T18:09:02
0.13
a17a93ef8f6a06ed8dfc3145276663786828df03
[ "front::wgsl::tests::binary_expression_mixed_scalar_and_vector_operands" ]
[ "arena::tests::fetch_or_append_non_unique", "arena::tests::append_non_unique", "arena::tests::append_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "back::spv::layout::test_physical_layout_in_words", "back::spv::writer::test_write_physical_layout", "back::spv::layout::t...
[]
[]
69
2023-08-18T13:08:28Z
gfx-rs/naga
2,342
gfx-rs__naga-2342
[ "2312" ]
423a069dcddc790fdf27d8c389fa4487f07fcc0a
diff --git a/src/front/wgsl/parse/mod.rs b/src/front/wgsl/parse/mod.rs --- a/src/front/wgsl/parse/mod.rs +++ b/src/front/wgsl/parse/mod.rs @@ -84,6 +84,18 @@ impl<'a> ExpressionContext<'a, '_, '_> { } Ok(accumulator) } + + fn declare_local(&mut self, name: ast::Ident<'a>) -> Result<Handle<ast:...
diff --git a/tests/in/lexical-scopes.wgsl b/tests/in/lexical-scopes.wgsl --- a/tests/in/lexical-scopes.wgsl +++ b/tests/in/lexical-scopes.wgsl @@ -1,45 +1,41 @@ fn blockLexicalScope(a: bool) { - let a = 1.0; { let a = 2; { - let a = true; + let a = 2.0; } - ...
[wgsl-in] Redefining parameter is incorreclty allowed The following snippet redefines an incoming parameter which should not compile (and Tint will complain about it!): ``` fn fun(t: f32) -> f32 { let t = t + 1.0; return t; } ```
2023-05-15T23:41:22
0.12
04ef22f6dc8d9c4b958dc6575bbb3be9d7719ee0
[ "function_param_redefinition_as_param", "function_param_redefinition_as_local" ]
[ "arena::tests::append_non_unique", "front::glsl::constants::tests::nan_handling", "arena::tests::fetch_or_append_unique", "back::msl::writer::test_stack_size", "front::glsl::constants::tests::unary_op", "front::glsl::lex::tests::lex_tokens", "arena::tests::fetch_or_append_non_unique", "back::spv::layo...
[]
[]
71
2023-05-30T11:55:39Z
gfx-rs/naga
2,290
gfx-rs__naga-2290
[ "1977" ]
dd54aaf26062384db0ecc7553c0fbe9534bb491e
diff --git a/src/front/spv/function.rs b/src/front/spv/function.rs --- a/src/front/spv/function.rs +++ b/src/front/spv/function.rs @@ -597,7 +597,11 @@ impl<'function> BlockContext<'function> { crate::Span::default(), ) } - su...
diff --git /dev/null b/tests/in/spv/do-while.spvasm new file mode 100644 --- /dev/null +++ b/tests/in/spv/do-while.spvasm @@ -0,0 +1,64 @@ +;; Ensure that `do`-`while`-style loops, with conditional backedges, are properly +;; supported, via `break if` (as `continuing { ... if c { break; } }` is illegal). +;; +;; The SP...
[spv-in] Conditional loop backedge not lowered to `Statement::Loop` with `break_if` expression Naga (https://github.com/gfx-rs/naga/commit/ab2806e05fbd69a502b4b25a85f99ae4d3e82278) rejects this SPIR-V: ``` OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint ...
@JCapucho any idea? (#1028 seems to have been fixed; maybe a regression somewhere?) I finally had some time to analyze this issue and it seems to be a combination of smaller issues. The part that's is causing all of this is ```rust %15 = OpLabel ; validCFG/StructurallyReachableBlock$2 // ... OpBranchCon...
2023-03-23T17:25:39
0.12
04ef22f6dc8d9c4b958dc6575bbb3be9d7719ee0
[ "convert_spv_all" ]
[ "arena::tests::fetch_or_append_unique", "arena::tests::append_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::append_non_unique", "back::msl::test_error_size", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[]
[]
72
2023-05-12T20:59:13Z
gfx-rs/naga
2,233
gfx-rs__naga-2233
[ "2169" ]
6be394dac31bc9796d4ae4bb450a40c6b6ee0b08
diff --git a/src/front/wgsl/error.rs b/src/front/wgsl/error.rs --- a/src/front/wgsl/error.rs +++ b/src/front/wgsl/error.rs @@ -134,7 +134,7 @@ pub enum NumberError { pub enum InvalidAssignmentType { Other, Swizzle, - ImmutableBinding, + ImmutableBinding(Span), } #[derive(Clone, Debug)] diff --git a...
diff --git a/tests/wgsl-errors.rs b/tests/wgsl-errors.rs --- a/tests/wgsl-errors.rs +++ b/tests/wgsl-errors.rs @@ -1624,13 +1624,56 @@ fn assign_to_let() { } ", r###"error: invalid left-hand side of assignment - ┌─ wgsl:4:10 + ┌─ wgsl:3:17 │ +3 │ let a = 10; + │ ...
[wgsl-in] Invalid assignment diagnostic doesn't extend to derived expressions Given this code: ```rs fn main() { let a = 1; a = 2; } ``` Naga errors with: ```rs error: invalid left-hand side of assignment ┌─ wgsl:3:2 │ 3 │ a = 2; │ ^ cannot assign to this expression │ = note: 'a...
2023-02-01T00:50:40
0.11
da8e911d9d207a7571241e875f7ac066856e8b3f
[ "assign_to_let" ]
[ "arena::tests::append_unique", "arena::tests::append_non_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "back::spv::layout::test_logical_layout_in_words", "back::spv::layout::test_physical_layout_in_words", "back::spv::writer:...
[]
[]
73
2023-02-01T11:38:30Z
gfx-rs/naga
2,056
gfx-rs__naga-2056
[ "2052" ]
4f8db997b0b1e73fc1e2cac070485333a5b61925
diff --git a/src/front/wgsl/lexer.rs b/src/front/wgsl/lexer.rs --- a/src/front/wgsl/lexer.rs +++ b/src/front/wgsl/lexer.rs @@ -273,7 +273,7 @@ impl<'a> Lexer<'a> { if next.0 == expected { Ok(next.1) } else { - Err(Error::Unexpected(next, ExpectedToken::Token(expected))) + ...
diff --git a/tests/wgsl-errors.rs b/tests/wgsl-errors.rs --- a/tests/wgsl-errors.rs +++ b/tests/wgsl-errors.rs @@ -1597,3 +1597,83 @@ fn break_if_bad_condition() { ) } } + +#[test] +fn swizzle_assignment() { + check( + " + fn f() { + var v = vec2(0); + v.xy = vec2(1...
Assignment to swizzle produces unhelpful error message Given the program: ``` fn f() { var v = vec2(0); v.xy = vec2(1); } ``` Naga complains: ``` error: the left-hand side of an assignment must be a reference ┌─ assign-to-swizzle.wgsl:2:20 │ 2 │ var v = vec2(0); │ ╭────────────────...
We could bake in some detection for this case and add it as note to the diagnostic, it would look something like this: ``` error: the left-hand side of an assignment must be a reference ┌─ test.wgsl:3:4 │ 3 │ v.xy = vec2(1); │ ^^^^ expression is not a reference │ = You seem to be trying to assig...
2022-09-14T16:05:36
0.9
4f8db997b0b1e73fc1e2cac070485333a5b61925
[ "assign_to_expr", "assign_to_let", "binary_statement", "swizzle_assignment" ]
[ "arena::tests::append_non_unique", "back::msl::test_error_size", "arena::tests::fetch_or_append_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::append_unique", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[]
[]
74
2023-02-01T17:40:31Z
gfx-rs/naga
2,055
gfx-rs__naga-2055
[ "2053" ]
1a99c1cf066de8d660904f1fb681f5647bc45205
diff --git a/src/front/wgsl/lexer.rs b/src/front/wgsl/lexer.rs --- a/src/front/wgsl/lexer.rs +++ b/src/front/wgsl/lexer.rs @@ -163,6 +163,8 @@ fn is_word_part(c: char) -> bool { pub(super) struct Lexer<'a> { input: &'a str, pub(super) source: &'a str, + // The byte offset of the end of the last non-trivia...
diff --git a/tests/wgsl-errors.rs b/tests/wgsl-errors.rs --- a/tests/wgsl-errors.rs +++ b/tests/wgsl-errors.rs @@ -640,11 +640,11 @@ fn reserved_keyword() { r#" var bool: bool = true; "#, - r###"error: name ` bool: bool = true;` is a reserved keyword - ┌─ wgsl:2:16 + r###"e...
Spans on expressions are bad Given the input: ``` fn f() { var v = vec2(0); v.xy = vec2(1); } ``` Naga produces the error message: ``` error: the left-hand side of an assignment must be a reference ┌─ assign-to-swizzle.wgsl:2:20 │ 2 │ var v = vec2(0); │ ╭───────────────────^ 3 │ │...
2022-09-14T02:11:09
0.9
4f8db997b0b1e73fc1e2cac070485333a5b61925
[ "module_scope_identifier_redefinition", "reserved_keyword" ]
[ "arena::tests::append_non_unique", "arena::tests::append_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "back::spv::layout::test_physical_layout_in_words", "back::spv::writer::test_write_physical_layout", "back::spv::layout::t...
[]
[]
75
2022-09-15T07:19:20Z
gfx-rs/naga
2,024
gfx-rs__naga-2024
[ "2021" ]
b209d911681c4ef563f7d9048623667743e6248f
diff --git a/src/front/mod.rs b/src/front/mod.rs --- a/src/front/mod.rs +++ b/src/front/mod.rs @@ -14,6 +14,7 @@ pub mod wgsl; use crate::{ arena::{Arena, Handle, UniqueArena}, proc::{ResolveContext, ResolveError, TypeResolution}, + FastHashMap, }; use std::ops; diff --git a/src/front/mod.rs b/src/fro...
diff --git /dev/null b/tests/in/lexical-scopes.wgsl new file mode 100644 --- /dev/null +++ b/tests/in/lexical-scopes.wgsl @@ -0,0 +1,58 @@ +fn blockLexicalScope(a: bool) { + let a = 1.0; + { + let a = 2; + { + let a = true; + } + let test = a == 3; + } + let test = a =...
[wgsl-in] let declarations from different scopes merged? Shadowed let declarations can get incorrectly hoisted out of conditional scopes. See example WGSL: ``` @vertex fn main(@location(0) cond: f32) -> @location(0) f32 { let value = 1.; if cond > 0. { let value = 2.; return 3.; } ...
2022-08-07T03:59:14
0.9
4f8db997b0b1e73fc1e2cac070485333a5b61925
[ "convert_wgsl" ]
[ "arena::tests::append_non_unique", "arena::tests::append_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "arena::tests::fetch_or_append_non_unique", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[]
[]
76
2022-09-03T15:30:55Z
gfx-rs/naga
1,917
gfx-rs__naga-1917
[ "1896" ]
ab2806e05fbd69a502b4b25a85f99ae4d3e82278
diff --git a/src/front/wgsl/construction.rs b/src/front/wgsl/construction.rs --- a/src/front/wgsl/construction.rs +++ b/src/front/wgsl/construction.rs @@ -184,12 +184,15 @@ fn parse_constructor_type<'a>( Ok(Some(ConstructorType::Vector { size, kind, width })) } (Token::Paren('<'), Constru...
diff --git a/tests/wgsl-errors.rs b/tests/wgsl-errors.rs --- a/tests/wgsl-errors.rs +++ b/tests/wgsl-errors.rs @@ -810,6 +810,39 @@ fn module_scope_identifier_redefinition() { ); } +#[test] +fn matrix_with_bad_type() { + check( + r#" + fn main() { + let m = mat2x2<i32>(); + ...
[wgsl-in] Error on matrices with non float scalar kinds The following works (on naga master cf32c2b): ````wgsl @group(0) @binding(0) var<storage, write> output_0: vec3<f32>; @compute @workgroup_size(1) fn main(@builtin(global_invocation_id) global_id: vec3<u32>) { let zero: f32 = 0.0; let zero_vec = vec3<f...
According to the latest version of the WGSL spec only floating point matrices are allowed. See https://gpuweb.github.io/gpuweb/wgsl/#matrix-types OK, thanks, that makes sense (I guess there's probably some platform that doesn't support it and WGSL therefore restricts to floats). I would then suggest to improve t...
2022-05-14T10:47:25
0.8
ea832a9eec13560560c017072d4318d5d942e5e5
[ "matrix_with_bad_type" ]
[ "arena::tests::fetch_or_append_non_unique", "arena::tests::fetch_or_append_unique", "arena::tests::append_unique", "arena::tests::append_non_unique", "back::msl::test_error_size", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[]
[]
79
2022-05-14T15:00:16Z
gfx-rs/naga
1,790
gfx-rs__naga-1790
[ "1774" ]
012f2a6b2e9328e93939429705fdf9102d9f69b7
diff --git /dev/null b/src/front/wgsl/construction.rs new file mode 100644 --- /dev/null +++ b/src/front/wgsl/construction.rs @@ -0,0 +1,649 @@ +use crate::{ + proc::TypeResolution, Arena, ArraySize, Bytes, Constant, ConstantInner, Expression, Handle, + ScalarKind, ScalarValue, Span as NagaSpan, Type, TypeInner, ...
diff --git a/tests/in/operators.wgsl b/tests/in/operators.wgsl --- a/tests/in/operators.wgsl +++ b/tests/in/operators.wgsl @@ -58,6 +58,21 @@ fn constructors() -> f32 { 0.0, 0.0, 0.0, 1.0, ); + // zero value constructors + var _ = bool(); + var _ = i32(); + var _ = u32(); + var _ = f32();...
WGSL constructor doesn't check length The following code produces an error message that was unhelpful ``` @stage(vertex) fn passthrough(@location(0) pos: vec2<f32>) -> @builtin(position) vec4<f32> { return vec4<f32>(pos); } ``` The error is: ``` [2022-03-13T21:53:32Z ERROR naga::valid::function] Retu...
2022-03-27T00:38:42
0.8
ea832a9eec13560560c017072d4318d5d942e5e5
[ "convert_wgsl", "bad_type_cast", "constructor_parameter_type_mismatch", "type_not_constructible", "type_not_inferrable", "unexpected_constructor_parameters" ]
[ "arena::tests::fetch_or_append_non_unique", "arena::tests::append_unique", "back::msl::test_error_size", "arena::tests::append_non_unique", "arena::tests::fetch_or_append_unique", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[ "back::msl::writer::test_stack_size" ]
[]
80
2022-03-30T08:34:25Z
gfx-rs/naga
1,787
gfx-rs__naga-1787
[ "1721" ]
05f050fad485763bf7bf6e1ad4206007b52bc345
diff --git a/src/front/wgsl/mod.rs b/src/front/wgsl/mod.rs --- a/src/front/wgsl/mod.rs +++ b/src/front/wgsl/mod.rs @@ -3743,6 +3743,40 @@ impl Parser { Some(crate::Statement::Loop { body, continuing }) } + "while" => { + let _ = l...
diff --git a/src/front/wgsl/tests.rs b/src/front/wgsl/tests.rs --- a/src/front/wgsl/tests.rs +++ b/src/front/wgsl/tests.rs @@ -262,6 +262,32 @@ fn parse_loop() { ", ) .unwrap(); + parse_str( + " + fn main() { + var found: bool = false; + var i: i32 = 0; + ...
While loop in WGSL See https://github.com/gpuweb/gpuweb/pull/2590
2022-03-22T18:25:33
0.8
ea832a9eec13560560c017072d4318d5d942e5e5
[ "front::wgsl::tests::parse_loop", "convert_wgsl" ]
[ "arena::tests::append_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::append_non_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "back::spv::layout::test_logical_layout_in_words", "back::spv::layout::test_physical_layout_in_words", "front::glsl::const...
[ "back::msl::writer::test_stack_size" ]
[]
81
2022-03-23T09:44:47Z
gfx-rs/naga
1,402
gfx-rs__naga-1402
[ "1019" ]
dc8a41de04068b4766c1e74f9d77f765e815172a
diff --git a/src/valid/function.rs b/src/valid/function.rs --- a/src/valid/function.rs +++ b/src/valid/function.rs @@ -135,6 +135,11 @@ bitflags::bitflags! { } } +struct BlockInfo { + stages: ShaderStages, + finished: bool, +} + struct BlockContext<'a> { abilities: ControlFlowAbility, info: &'a...
diff --git a/tests/wgsl-errors.rs b/tests/wgsl-errors.rs --- a/tests/wgsl-errors.rs +++ b/tests/wgsl-errors.rs @@ -848,3 +848,34 @@ fn invalid_local_vars() { if local_var_name == "not_okay" } } + +#[test] +fn dead_code() { + check_validation_error! { + " + fn dead_code_after_if(condition...
Naga doesn't detect unreachable code The following test, if added to `wgsl-errors.rs`, should fail, but it passes: ``` check_validation_error! { " fn dead_code_after_if(condition: bool) -> i32 { if (condition) { return 1; } else { return 2; } r...
2021-09-20T23:46:59
0.6
2e7d629aefe6857ade4f96fe2c3dc1a09f0fa4db
[ "dead_code" ]
[ "arena::tests::append_unique", "arena::tests::fetch_or_append_non_unique", "back::msl::test_error_size", "arena::tests::append_non_unique", "arena::tests::fetch_or_append_unique", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[ "back::msl::writer::test_stack_size" ]
[]
82
2021-09-24T14:11:33Z
gfx-rs/naga
1,390
gfx-rs__naga-1390
[ "1386" ]
d7ca7d43b987c17f553db2823d833646ff1d48e0
diff --git a/src/front/wgsl/lexer.rs b/src/front/wgsl/lexer.rs --- a/src/front/wgsl/lexer.rs +++ b/src/front/wgsl/lexer.rs @@ -336,7 +336,7 @@ fn consume_token(mut input: &str, generic: bool) -> (Token<'_>, &str) { } } '0'..='9' => consume_number(input), - 'a'..='z' | 'A'..='Z' | '...
diff --git a/src/front/wgsl/lexer.rs b/src/front/wgsl/lexer.rs --- a/src/front/wgsl/lexer.rs +++ b/src/front/wgsl/lexer.rs @@ -655,6 +655,7 @@ fn test_tokens() { ); sub_test("No¾", &[Token::Word("No"), Token::Unknown('¾')]); sub_test("No好", &[Token::Word("No"), Token::Unknown('好')]); + sub_test("_No",...
naga should reject identifiers beginning with underscore This should fail compilation. But Naga allows it. ``` let _123 = 123; ```
2021-09-18T04:35:00
0.6
2e7d629aefe6857ade4f96fe2c3dc1a09f0fa4db
[ "front::wgsl::lexer::test_tokens" ]
[ "arena::tests::fetch_or_append_unique", "arena::tests::append_non_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::append_unique", "back::msl::test_error_size", "back::spv::layout::test_physical_layout_in_words", "back::spv::writer::test_write_physical_layout", "back::spv::layout::t...
[ "back::msl::writer::test_stack_size" ]
[]
83
2021-09-24T14:12:35Z
gfx-rs/naga
1,384
gfx-rs__naga-1384
[ "1382" ]
73f9d072079246ccf119c4e27de2b624afa6e466
diff --git a/src/back/wgsl/writer.rs b/src/back/wgsl/writer.rs --- a/src/back/wgsl/writer.rs +++ b/src/back/wgsl/writer.rs @@ -51,56 +51,6 @@ enum Indirection { Reference, } -/// Return the sort of indirection that `expr`'s plain form evaluates to. -/// -/// An expression's 'plain form' is the most general rend...
diff --git /dev/null b/tests/in/pointers.param.ron new file mode 100644 --- /dev/null +++ b/tests/in/pointers.param.ron @@ -0,0 +1,7 @@ +( + spv: ( + version: (1, 2), + debug: true, + adjust_coordinate_space: false, + ), +) diff --git /dev/null b/tests/in/pointers.wgsl new file mode 100644 --- /dev/null +++ b/tests/...
Naga produces incorrect WGSL for let-bound pointers The following WGSL input generates incorrect WGSL output: ``` fn f() { var v: vec2<i32>; let px = &v.x; *px = 10; } ``` The output omits the `*`: ``` fn f() { var v: vec2<i32>; let px: ptr<function, i32> = (&v.x); px = 10; ...
2021-09-17T09:50:57
0.6
2e7d629aefe6857ade4f96fe2c3dc1a09f0fa4db
[ "convert_wgsl" ]
[ "arena::tests::append_unique", "arena::tests::append_non_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::test_logical_layout_in_words", "back::spv::writer:...
[ "back::msl::writer::test_stack_size" ]
[]
84
2021-09-28T17:03:01Z
gfx-rs/naga
1,367
gfx-rs__naga-1367
[ "1356" ]
933ecc4a443cb882bce0283fe77897bba6007080
diff --git a/src/front/wgsl/mod.rs b/src/front/wgsl/mod.rs --- a/src/front/wgsl/mod.rs +++ b/src/front/wgsl/mod.rs @@ -165,9 +165,9 @@ pub enum Error<'a> { MissingType(Span), InvalidAtomicPointer(Span), InvalidAtomicOperandType(Span), + Pointer(&'static str, Span), NotPointer(Span), - AddressO...
diff --git a/tests/wgsl-errors.rs b/tests/wgsl-errors.rs --- a/tests/wgsl-errors.rs +++ b/tests/wgsl-errors.rs @@ -493,6 +493,44 @@ fn local_var_missing_type() { ); } +#[test] +fn postfix_pointers() { + check( + r#" + fn main() { + var v: vec4<f32> = vec4<f32>(1.0, 1.0, 1.0, ...
[wgsl-in] Missing parentheses around dereference https://github.com/gfx-rs/naga/pull/1348 fixed this for wgsl-out, but the following still incorrectly validates: ``` [[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> { var v: vec4<f32> = vec4<f32>(1.0, 1.0, 1.0, 1.0); let pv = &v; let a ...
I've reproduced this. Indeed, `*pv[3]` parenthesizes as `*(pv[3])`, which is ill-typed. Naga's WGSL front end doesn't follow the grammar in the spec very closely, so I think there are a number of problems along these lines. See also #1352. This was not fixed by #1360. The [approach](https://github.com/gfx-rs/naga/bl...
2021-09-15T11:04:10
0.6
2e7d629aefe6857ade4f96fe2c3dc1a09f0fa4db
[ "postfix_pointers", "valid_access" ]
[ "arena::tests::fetch_or_append_unique", "arena::tests::fetch_or_append_non_unique", "back::msl::test_error_size", "arena::tests::append_unique", "arena::tests::append_non_unique", "back::spv::layout::test_logical_layout_in_words", "back::spv::layout::test_physical_layout_in_words", "front::glsl::const...
[ "back::msl::writer::test_stack_size" ]
[]
85
2021-09-15T22:52:26Z
gfx-rs/naga
377
gfx-rs__naga-377
[ "367" ]
292304b66f27c7f07b855c929bdf671c14dd904d
diff --git a/src/front/wgsl/mod.rs b/src/front/wgsl/mod.rs --- a/src/front/wgsl/mod.rs +++ b/src/front/wgsl/mod.rs @@ -265,24 +265,31 @@ enum Composition { } impl Composition { + //TODO: could be `const fn` once MSRV allows + fn letter_pos(letter: char) -> u32 { + match letter { + 'x' | 'r' ...
diff --git a/src/front/wgsl/tests.rs b/src/front/wgsl/tests.rs --- a/src/front/wgsl/tests.rs +++ b/src/front/wgsl/tests.rs @@ -150,5 +150,7 @@ fn parse_texture_load() { #[test] fn parse_postfix() { + parse_str("fn foo() { const x: f32 = vec4<f32>(1.0, 2.0, 3.0, 4.0).xyz.rgbr.aaaa.wz.g; }") + .unwrap(); ...
Accessor rgba doesn't work ` ParseError { error: BadAccessor("r"), scopes: [FunctionDecl, Block, Statement, GeneralExpr, SingularExpr], pos: (36, 32) }'` It seems it is supposed to according to the specs. ```wgsl fn main() { var test: vec2<f32> = vec2<f32>(1.0, 1.0); out_target = vec4<f32>( test.r, 1.0...
2021-01-27T05:55:16
0.2
292304b66f27c7f07b855c929bdf671c14dd904d
[ "front::wgsl::tests::parse_postfix" ]
[ "arena::tests::append_non_unique", "arena::tests::append_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::fetch_or_append_unique", "back::spv::layout_tests::test_instruction_add_operand", "back::spv::layout_tests::test_instruction_add_operands", "back::spv::layout_tests::test_instruct...
[]
[]
86
2021-01-26T22:04:17Z
gfx-rs/naga
376
gfx-rs__naga-376
[ "368" ]
986550aff8767fe541fb9e2fc3a7e01e16f1dc21
diff --git a/src/front/wgsl/mod.rs b/src/front/wgsl/mod.rs --- a/src/front/wgsl/mod.rs +++ b/src/front/wgsl/mod.rs @@ -947,12 +947,13 @@ impl Parser { Some(expr) => ctx.expressions.append(expr), None => { *lexer = backup; - let handle = self.parse_primary_expres...
diff --git a/src/front/wgsl/tests.rs b/src/front/wgsl/tests.rs --- a/src/front/wgsl/tests.rs +++ b/src/front/wgsl/tests.rs @@ -147,3 +147,8 @@ fn parse_texture_load() { ) .unwrap(); } + +#[test] +fn parse_postfix() { + parse_str("fn foo() { const x: f32 = fract(vec2<f32>(0.5, 1.0)).x; }").unwrap(); +}
Cannot swizzle the return value of a function I couldn't swizzle function return values such as `textureSample( ... ).x` `ParseError { error: Unexpected(Separator('.')), scopes: [FunctionDecl, Block, Statement], pos: (34, 86) }',` ```wgsl [[stage(fragment)]] fn main() { var test: vec2<f32> = vec2<f32>(1.0...
2021-01-27T05:40:56
0.2
292304b66f27c7f07b855c929bdf671c14dd904d
[ "front::wgsl::tests::parse_postfix" ]
[ "arena::tests::fetch_or_append_non_unique", "arena::tests::append_unique", "arena::tests::append_non_unique", "arena::tests::fetch_or_append_unique", "back::spv::layout_tests::test_instruction_add_operand", "back::spv::layout_tests::test_instruction_add_operands", "back::spv::layout_tests::test_instruct...
[]
[]
87
2021-01-26T21:44:23Z
gfx-rs/naga
723
gfx-rs__naga-723
[ "635" ]
daf4c82376e10d03488d7c71773b2acc1b9f7de4
diff --git a/src/back/spv/instructions.rs b/src/back/spv/instructions.rs --- a/src/back/spv/instructions.rs +++ b/src/back/spv/instructions.rs @@ -433,12 +433,12 @@ impl super::Instruction { } pub(super) fn store( - pointer_type_id: Word, + pointer_id: Word, object_id: Word, ...
diff --git /dev/null b/tests/in/access.param.ron new file mode 100644 --- /dev/null +++ b/tests/in/access.param.ron @@ -0,0 +1,7 @@ +( + spv_version: (1, 1), + spv_capabilities: [ Shader, Image1D, Sampled1D ], + spv_debug: true, + spv_adjust_coordinate_space: false, + msl_custom: false, +) diff --git /dev/null b/tests/...
Indexing constant arrays in SPIR-V ```rust struct VertexOutput { [[builtin(position)]] position: vec4<f32>; [[location(0)]] tex_coords: vec2<f32>; }; [[stage(vertex)]] fn vs_main([[builtin(vertex_index)]] index: u32) -> VertexOutput { const triangle = array<vec2<f32>, 3u>( vec2<f32>(-1.0, ...
2021-04-16T11:12:42
0.3
77a64da189e6ed2c4631ca03cb01b8d8124c4dad
[ "convert_wgsl" ]
[ "arena::tests::append_unique", "arena::tests::fetch_or_append_non_unique", "arena::tests::append_non_unique", "arena::tests::fetch_or_append_unique", "back::msl::test_error_size", "back::spv::writer::test_write_physical_layout", "back::spv::layout::test_physical_layout_in_words", "back::spv::layout::t...
[ "back::msl::writer::test_stack_size" ]
[]
89
2021-04-16T21:11:22Z
dimforge/nalgebra
1,384
dimforge__nalgebra-1384
[ "1380" ]
a803815bd1d22a052690cfde3ff7fae26cd91152
diff --git a/src/linalg/inverse.rs b/src/linalg/inverse.rs --- a/src/linalg/inverse.rs +++ b/src/linalg/inverse.rs @@ -145,13 +145,44 @@ where { let m = m.as_slice(); - out[(0, 0)] = m[5].clone() * m[10].clone() * m[15].clone() + let cofactor00 = m[5].clone() * m[10].clone() * m[15].clone() - m[5...
diff --git a/tests/core/matrix.rs b/tests/core/matrix.rs --- a/tests/core/matrix.rs +++ b/tests/core/matrix.rs @@ -1263,6 +1263,16 @@ fn column_iterator_double_ended_mut() { assert_eq!(col_iter_mut.next(), None); } +#[test] +fn test_inversion_failure_leaves_matrix4_unchanged() { + let mut mat = na::Matrix4::...
Inverting a 4x4 matrix with `try_inverse_mut` doesn't leave `self` unchanged if the inversion fails. Calling `try_inverse_mut` on a 4x4 matrix uses [`do_inverse4`](https://github.com/dimforge/nalgebra/blob/a803815bd1d22a052690cfde3ff7fae26cd91152/src/linalg/inverse.rs#L139) which modifies `out` before checking the dete...
2024-04-19T23:01:31
0.32
a803815bd1d22a052690cfde3ff7fae26cd91152
[ "core::matrix::test_inversion_failure_leaves_matrix4_unchanged" ]
[ "base::indexing::dimrange_range_usize", "base::indexing::dimrange_rangefrom_dimname", "base::indexing::dimrange_rangefull", "base::indexing::dimrange_rangefrom_usize", "base::indexing::dimrange_rangeinclusive_usize", "base::indexing::dimrange_rangeto_usize", "base::indexing::dimrange_rangetoinclusive_us...
[]
[ "geometry::rotation::proptest_tests::slerp_takes_shortest_path_3" ]
90
2024-05-05T10:05:36Z
dimforge/nalgebra
1,369
dimforge__nalgebra-1369
[ "1368" ]
749a9fee17028291fd47b8ea3c8d3baab53229a4
diff --git a/src/linalg/householder.rs b/src/linalg/householder.rs --- a/src/linalg/householder.rs +++ b/src/linalg/householder.rs @@ -34,6 +34,17 @@ pub fn reflection_axis_mut<T: ComplexField, D: Dim, S: StorageMut<T, D>>( if !factor.is_zero() { column.unscale_mut(factor.sqrt()); + + // Normaliz...
diff --git a/tests/linalg/eigen.rs b/tests/linalg/eigen.rs --- a/tests/linalg/eigen.rs +++ b/tests/linalg/eigen.rs @@ -1,4 +1,4 @@ -use na::DMatrix; +use na::{DMatrix, Matrix3}; #[cfg(feature = "proptest-support")] mod proptest_tests { diff --git a/tests/linalg/eigen.rs b/tests/linalg/eigen.rs --- a/tests/linalg/ei...
SVD Computes Wrong Singular Values for Very Small-Valued Matrices This should be reproducible with `nalgebra = { version = "0.32.4", features = ["rand"] }` ``` use nalgebra::Matrix3; fn main() { let id = Matrix3::<f32>::identity(); loop { let r = Matrix3::<f32>::new_random(); let m = ...
There was a similar issue in https://github.com/dimforge/nalgebra/pull/1314, but I think the fix for that was included in 0.32.4. Maybe an interesting reference all the same.
2024-03-09T00:51:58
0.32
a803815bd1d22a052690cfde3ff7fae26cd91152
[ "linalg::eigen::very_small_deviation_from_identity_issue_1368" ]
[ "base::indexing::dimrange_range_usize", "base::indexing::dimrange_usize", "base::indexing::dimrange_rangefrom_usize", "base::indexing::dimrange_rangefrom_dimname", "linalg::symmetric_eigen::test::wilkinson_shift_zero", "linalg::symmetric_eigen::test::wilkinson_shift_zero_det", "linalg::symmetric_eigen::...
[]
[]
91
2024-03-28T14:26:12Z
anoma/namada
2,667
anoma__namada-2667
[ "2665" ]
2ba001dd639d0fe14c4461c4e4811778d4ff50d8
diff --git /dev/null b/.changelog/unreleased/bug-fixes/2667-fix-last-update-usage.md new file mode 100644 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/2667-fix-last-update-usage.md @@ -0,0 +1,2 @@ +- Fix the setting of the last update field in an Epoched data structure. + ([\#2667](https://github.com/anoma/nama...
diff --git a/crates/proof_of_stake/src/tests/test_validator.rs b/crates/proof_of_stake/src/tests/test_validator.rs --- a/crates/proof_of_stake/src/tests/test_validator.rs +++ b/crates/proof_of_stake/src/tests/test_validator.rs @@ -1320,8 +1320,20 @@ fn test_purge_validator_information_aux(validators: Vec<GenesisValidat...
All uses of `Epoched` past epoch tracking and handling of `last_update` may not be consistent A storage dump from epoch 8 at height 35201 had the following storage ket structure for a validator: ``` "#tnam1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc8j2fp/validator/#tnam1q96tsxckvm4n937efh7t78w4j40m5783wsqcz3ye/state/last_upd...
2024-02-20T12:43:01
0.31
cc3edde4d572ff41f19d24b5b7da60406acdfdf4
[ "tests::test_validator::test_purge_validator_information" ]
[ "tests::test_helper_fns::test_apply_list_slashes", "tests::test_helper_fns::test_compute_amount_after_slashing_withdraw", "tests::test_helper_fns::test_compute_amount_after_slashing_unbond", "tests::test_helper_fns::test_compute_slashable_amount", "tests::test_helper_fns::test_compute_slash_bond_at_epoch", ...
[]
[]
92
2024-04-12T10:22:06Z
anoma/namada
2,628
anoma__namada-2628
[ "2626" ]
cc3edde4d572ff41f19d24b5b7da60406acdfdf4
diff --git /dev/null b/.changelog/unreleased/bug-fixes/2628-fix-validator-voting-period.md new file mode 100644 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/2628-fix-validator-voting-period.md @@ -0,0 +1,2 @@ +- Fixes the computation of the valid validator voting period. + ([\#2628](https://github.com/anoma/nam...
diff --git a/crates/governance/src/utils.rs b/crates/governance/src/utils.rs --- a/crates/governance/src/utils.rs +++ b/crates/governance/src/utils.rs @@ -1347,7 +1350,7 @@ mod test { } #[test] - fn test_proposal_fifthteen() { + fn test_proposal_fifteen() { let mut proposal_votes = ProposalVo...
Gov VP: buggy `is_valid_validator_voting_period` The function `is_valid_validator_voting_period` in the governance VP incorrectly does division on u64 before multiplication, which sometimes unintentionally leads to a computation of 0. It is also does not align with the same computation in `StorageProposal::can_be_voted...
2024-02-16T00:53:51
0.31
cc3edde4d572ff41f19d24b5b7da60406acdfdf4
[ "utils::test::test_validator_voting_period" ]
[ "utils::test::test_proposal_eight", "utils::test::test_proposal_eleven", "utils::test::test_proposal_four", "utils::test::test_proposal_six", "utils::test::test_proposal_fourteen", "utils::test::test_proposal_thirteen", "utils::test::test_proposal_ten", "utils::test::test_proposal_one", "utils::test...
[]
[]
93
2024-03-19T01:52:08Z
anoma/namada
3,888
anoma__namada-3888
[ "3872" ]
ad1d4b3aa6c0d9052418b6897c9c13da0c9613f4
diff --git /dev/null b/.changelog/unreleased/improvements/3882-better-batch-construction.md new file mode 100644 --- /dev/null +++ b/.changelog/unreleased/improvements/3882-better-batch-construction.md @@ -0,0 +1,2 @@ +- Improved batch construction to reduce the size of the resulting tx. + ([\#3882](https://github.com...
diff --git a/crates/tx/src/types.rs b/crates/tx/src/types.rs --- a/crates/tx/src/types.rs +++ b/crates/tx/src/types.rs @@ -1324,6 +1357,11 @@ mod test { let data_bytes2 = "WASD".as_bytes(); let memo_bytes2 = "hjkl".as_bytes(); + // Some duplicated sections + let code_bytes3 = code_byte...
Avoid duplicated sections when batching In the function we use to construct a batch we push all the sections of an inner tx in the batch, even though some of these might already be present. https://github.com/anoma/namada/blob/810c258af3ddf2483af4d1306644db09bb2987e3/crates/tx/src/types.rs#L149-L158 We should try...
2024-10-04T17:18:51
0.44
03d9a589f54a43ebda2faaddb462f4991041ad26
[ "types::test::test_batched_tx_sections" ]
[ "data::test_process_tx::test_process_tx_raw_tx_no_data", "data::wrapper::test_gas_limits::test_gas_limit_roundtrip", "tests::encoding_round_trip", "types::test::test_protocol_tx_signing", "data::test_process_tx::test_process_tx_raw_tx_some_signed_data", "types::test::test_tx_json_serialization", "data::...
[]
[]
94
2024-10-04T13:28:45Z
anoma/namada
3,882
anoma__namada-3882
[ "3872" ]
418ef64b9e65bcf381faf4d37391d3a5ce6fdb2a
diff --git /dev/null b/.changelog/unreleased/improvements/3882-better-batch-construction.md new file mode 100644 --- /dev/null +++ b/.changelog/unreleased/improvements/3882-better-batch-construction.md @@ -0,0 +1,2 @@ +- Improved batch construction to reduce the size of the resulting tx. + ([\#3882](https://github.com...
diff --git a/crates/tx/src/types.rs b/crates/tx/src/types.rs --- a/crates/tx/src/types.rs +++ b/crates/tx/src/types.rs @@ -1324,6 +1357,11 @@ mod test { let data_bytes2 = "WASD".as_bytes(); let memo_bytes2 = "hjkl".as_bytes(); + // Some duplicated sections + let code_bytes3 = code_byte...
Avoid duplicated sections when batching In the function we use to construct a batch we push all the sections of an inner tx in the batch, even though some of these might already be present. https://github.com/anoma/namada/blob/810c258af3ddf2483af4d1306644db09bb2987e3/crates/tx/src/types.rs#L149-L158 We should try...
2024-10-03T21:52:35
0.44
03d9a589f54a43ebda2faaddb462f4991041ad26
[ "types::test::test_batched_tx_sections" ]
[ "data::test_process_tx::test_process_tx_raw_tx_no_data", "data::test_process_tx::test_process_tx_raw_tx_some_data", "data::test_process_tx::test_process_tx_raw_tx_some_signed_data", "tests::encoding_round_trip", "data::test_process_tx::test_process_tx_wrapper_tx", "sign::test::test_standalone_signing", ...
[]
[]
95
2024-10-04T09:17:21Z
anoma/namada
1,993
anoma__namada-1993
[ "648", "454" ]
7ed1058700efb9466e351f08c20f6bc9a77a3515
diff --git /dev/null b/.changelog/unreleased/bug-fixes/1993-fst-epoch-start-height.md new file mode 100644 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/1993-fst-epoch-start-height.md @@ -0,0 +1,2 @@ +- Fix the start block height of the first epoch. + ([\#1993](https://github.com/anoma/namada/pull/1993)) \ No ne...
diff --git a/apps/src/lib/node/ledger/storage/mod.rs b/apps/src/lib/node/ledger/storage/mod.rs --- a/apps/src/lib/node/ledger/storage/mod.rs +++ b/apps/src/lib/node/ledger/storage/mod.rs @@ -498,8 +498,9 @@ mod tests { None, Some(5), ); + let new_epoch_start = BlockHeight(1); ...
Mismatch in initial block heights at genesis The initial block height of the chain according to `request::InitChain` from tower ABCI is 1 ([see code here](https://github.com/anoma/namada/blob/546a043f023e329b815d7cb6dfa49d33425a02a9/apps/src/lib/node/ledger/shell/init_chain.rs#L52-L55)), which does not match the initia...
Related: https://github.com/anoma/namada/issues/377 We should look to remove `BlockHeight(0)` in general from our code since it doesn't exist (and change `BlockHeight::default()` to be `BlockHeight(1)` instead of `BlockHeight(0)`) Good catch! Looks like we should be setting our block height from the `initial_height`...
2023-10-17T14:02:47
0.23
7ed1058700efb9466e351f08c20f6bc9a77a3515
[ "ledger::storage::tests::update_epoch_after_its_duration", "protocol::transactions::bridge_pool_roots::test_apply_bp_roots_to_storage::test_bp_roots_across_epoch_boundaries", "protocol::transactions::votes::update::tests::test_calculate_one_vote_seen", "protocol::transactions::votes::update::tests::test_calcu...
[ "ledger::eth_bridge::storage::bridge_pool::test_bridge_pool_tree::test_contains_key", "ledger::eth_bridge::storage::bridge_pool::test_bridge_pool_tree::test_proof_all_leaves", "ledger::eth_bridge::storage::bridge_pool::test_bridge_pool_tree::test_delete_all_keys", "ledger::eth_bridge::storage::bridge_pool::te...
[]
[]
96
2023-12-07T17:59:02Z
tweag/nickel
1,296
tweag__nickel-1296
[ "952" ]
1be55fd6a31be8b635f542d6b1221bb1dea164f7
diff --git a/src/error.rs b/src/error.rs --- a/src/error.rs +++ b/src/error.rs @@ -141,17 +141,25 @@ pub enum EvalError { #[derive(Clone, Debug, Eq, PartialEq)] pub enum IllegalPolymorphicTailAction { + FieldAccess { field: String }, Map, Merge, + RecordRemove { field: String }, } impl IllegalPo...
diff --git a/tests/integration/contracts_fail.rs b/tests/integration/contracts_fail.rs --- a/tests/integration/contracts_fail.rs +++ b/tests/integration/contracts_fail.rs @@ -210,28 +210,28 @@ fn records_contracts_poly() { f { a | default = 100, b = 1 } "#, ), + ( + ...
Correctly assign blame when accessing a field in the tail of a polymorphically-sealed record Currently accessing a field which is sealed into the tail of a polymorphically-sealed record raises a missing field error. However, given that this is essentially an attempt to violate the polymorphic record contract that seale...
2023-05-05T20:22:31
0.3
1be55fd6a31be8b635f542d6b1221bb1dea164f7
[ "contracts_fail::records_contracts_poly" ]
[ "environment::tests::test_deepness", "environment::tests::test_env_base", "environment::tests::test_clone", "environment::tests::test_iter_elem", "environment::tests::test_iter_layer", "eval::merge::split::tests::all_left", "eval::merge::split::tests::all_center", "eval::merge::split::tests::all_right...
[]
[]
97
2023-05-05T15:16:16Z
tweag/nickel
1,272
tweag__nickel-1272
[ "1228" ]
116fdb3591cf75ded2ccc411dd18fe2d1f368369
diff --git a/lsp/nls/src/requests/completion.rs b/lsp/nls/src/requests/completion.rs --- a/lsp/nls/src/requests/completion.rs +++ b/lsp/nls/src/requests/completion.rs @@ -248,8 +248,8 @@ fn find_fields_from_type( ) -> Vec<IdentWithType> { match &ty.types { TypeF::Record(row) => find_fields_from_rrows(row...
diff --git a/src/types.rs b/src/types.rs --- a/src/types.rs +++ b/src/types.rs @@ -1125,6 +1178,7 @@ mod test { /// Note that there are infinitely many string representations of the same type since, for /// example, spaces are ignored: for the outcome of this function to be meaningful, the /// original t...
Polymorphic contracts and contract propagation seem fundamentally incompatible #1141 made dictionary contracts (or, should I say, dictionary type, as we will see that the difference matters) behave more lazily, and be overriding friendly. The gist is that `{foo = ..., bar = ..., baz = ...} | {_ : T}` is now strictly eq...
Regarding our way forward, I would like to see a dictionary contract syntax `{_ | T}` anyway. I've had informal discussions with people unfamiliar with Nickel and writing record contracts with `|`, but needing to write dictionary contracts as `{_ : T}` even outside a statically typed context was confusing to them. O...
2023-04-21T02:10:34
0.3
1be55fd6a31be8b635f542d6b1221bb1dea164f7
[ "types::test::types_pretty_printing", "contracts_fail::contracts_dont_capture_typevar", "contracts_fail::dictionary_contracts", "pass::check_file_tests_integration_pass_records_ncl", "pretty::records", "check_error_snapshots_tests_snapshot_inputs_errors_dictionary_contract_fail_ncl" ]
[ "environment::tests::test_deepness", "environment::tests::test_env_base", "environment::tests::test_clone", "environment::tests::test_iter_elem", "environment::tests::test_iter_layer", "eval::merge::split::tests::all_center", "eval::merge::split::tests::all_left", "eval::merge::split::tests::all_right...
[]
[]
98
2023-04-21T13:50:47Z
railwayapp/nixpacks
723
railwayapp__nixpacks-723
[ "722" ]
63420d6a2d07d1704f32a4f6c87de02acf147ed0
diff --git /dev/null b/examples/go-cgo-enabled/nixpacks.toml new file mode 100644 --- /dev/null +++ b/examples/go-cgo-enabled/nixpacks.toml @@ -0,0 +1,2 @@ +[variables] +CGO_ENABLED = "1" diff --git a/src/nixpacks/plan/generator.rs b/src/nixpacks/plan/generator.rs --- a/src/nixpacks/plan/generator.rs +++ b/src/nixpacks...
diff --git a/examples/go-cgo-enabled/test.env /dev/null --- a/examples/go-cgo-enabled/test.env +++ /dev/null @@ -1,3 +0,0 @@ -# Note: You do NOT need this for your project. This file is only used for testing purposes. - -ENVS="CGO_ENABLED=1" diff --git a/src/nixpacks/environment.rs b/src/nixpacks/environment.rs --- a/s...
nixpacks.toml `VARIABLES` aren't read by providers ### Is there an existing issue for this? - [X] I have searched the existing issues ### Describe the bug a variable defined in nixpacks.toml "VARIABLES" section does not get read by providers. ### To reproduce _No response_ ### Expected behavior _No response_ ##...
This happend to me too. ``` [variables] NIXPACKS_NODE_VERSION=14.18.2 ``` is ignored on build. Setting the variable on the service through railway's UI works fine.
2022-12-16T06:38:18
0.16
63420d6a2d07d1704f32a4f6c87de02acf147ed0
[ "go_cgo_enabled" ]
[ "nixpacks::app::tests::test_is_file_executable", "nixpacks::app::tests::test_creates_app", "nixpacks::app::tests::test_read_file", "nixpacks::app::tests::test_read_json_file", "nixpacks::app::tests::test_static_asset_path", "nixpacks::app::tests::test_strip_source_path", "nixpacks::builder::docker::cach...
[ "test_clojure_ring_app", "test_cobol_no_index", "test_clojure", "test_cobol_src_my_app", "test_cobol_src_index", "test_django_mysql", "test_django", "test_django_pipfile", "test_cobol", "test_cobol_my_app", "test_bun", "test_cobol_free", "test_bun_web_server", "test_cowsay", "test_deno",...
[]
100
2022-12-15T22:53:34Z
railwayapp/nixpacks
839
railwayapp__nixpacks-839
[ "751" ]
421469aaa5bf4f7b418aa0c91e303aabce6068da
diff --git /dev/null b/examples/ruby-rails-api-app/.gitattributes new file mode 100644 --- /dev/null +++ b/examples/ruby-rails-api-app/.gitattributes @@ -0,0 +1,7 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb li...
diff --git /dev/null b/examples/ruby-rails-api-app/Gemfile.lock new file mode 100644 --- /dev/null +++ b/examples/ruby-rails-api-app/Gemfile.lock @@ -0,0 +1,162 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.4.3) + actionpack (= 7.0.4.3) + activesupport (= 7.0.4.3) + nio4r (~> 2...
Ruby: Rails build fails when configured as an api ### Is there an existing issue for this? - [X] I have searched the existing issues ### Describe the bug I ran into a build failure when attempting to deploy a new Rails API to Railway using the `railway up` command. It appears that the build fails when it tr...
I've not ever used Rust before and don't know how complicated this would be to fix, but I'd be happy to try and submit a PR if this is a rails feature you want to support. I think you can fix this in a `nixpacks.toml` config file: ```toml [phases.build] cmds = [] # remove this to re-enable asset building ```
2023-03-25T01:43:29
1.5
421469aaa5bf4f7b418aa0c91e303aabce6068da
[ "ruby_rails_api_app" ]
[ "nixpacks::app::tests::test_creates_app", "nixpacks::app::tests::test_is_file_executable", "nixpacks::app::tests::test_read_file", "nixpacks::app::tests::test_strip_source_path", "nixpacks::app::tests::test_static_asset_path", "nixpacks::app::tests::test_strip_source_path_no_source_prefix", "nixpacks::a...
[ "test_cobol_no_index", "test_cobol_src_index", "test_cobol_src_my_app", "test_clojure_ring_app", "test_clojure", "test_cowsay", "test_cobol_my_app", "test_cobol", "test_cobol_free", "test_bun_web_server", "test_bun", "test_clojure_tools_build", "test_django", "test_django_pipfile", "test...
[]
102
2023-03-25T00:32:27Z
railwayapp/nixpacks
453
railwayapp__nixpacks-453
[ "445" ]
997fbd12287738b06ce53ca510327db9ddebbdf6
diff --git a/src/nixpacks/environment.rs b/src/nixpacks/environment.rs --- a/src/nixpacks/environment.rs +++ b/src/nixpacks/environment.rs @@ -1,4 +1,5 @@ -use anyhow::{bail, Result}; +use anyhow::Result; +use regex::Regex; use std::{collections::BTreeMap, env}; pub type EnvironmentVariables = BTreeMap<String, Stri...
diff --git a/src/nixpacks/environment.rs b/src/nixpacks/environment.rs --- a/src/nixpacks/environment.rs +++ b/src/nixpacks/environment.rs @@ -87,8 +91,9 @@ mod tests { } #[test] - fn test_create_invalid_environment() { - assert!(Environment::from_envs(vec!["INVALID=ENV=CONFIG"]).is_err()); + f...
Unable to parse variable string ### Is there an existing issue for this? - [X] I have searched the existing issues ### Describe the bug I'm trying to pass some weird env variables for a Laravel app but I get "Unable to parse variable string". ``` nixpacks build . --name testing --env "APP_KEY=base64:abcdef...=" ...
2022-08-28T03:24:16
0.3
0010fbcfc812ce3588204f805dba01e7546f502b
[ "nixpacks::environment::tests::test_create_equals_sign_parsing" ]
[ "nixpacks::app::tests::test_creates_app", "nixpacks::app::tests::test_read_file", "nixpacks::app::tests::test_read_structured_json_file", "nixpacks::app::tests::test_read_json_file", "nixpacks::app::tests::test_static_asset_path", "nixpacks::app::tests::test_read_toml_file", "nixpacks::app::tests::test_...
[ "test_csharp", "test_clojure_ring_app", "test_django", "test_bun_web_server", "test_clojure", "test_go", "test_fsharp", "test_elixir_no_ecto", "test_node", "test_deno", "test_cowsay", "test_go_custom_version", "test_bun", "test_crystal", "test_dart", "test_node_canvas", "test_java_ma...
[]
103
2022-08-29T16:35:22Z
railwayapp/nixpacks
436
railwayapp__nixpacks-436
[ "433" ]
cf3cd99aaef2513c1ca6d63c4bc6458742890fc6
diff --git /dev/null b/.gitattributes new file mode 100644 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,1 @@ +* text=auto eol=lf diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -380,6 +380,7 @@ dependencies = [ "globset", "indoc", "insta", + "path-slash", "rand 0.8.5", "regex", "s...
diff --git a/src/providers/node/mod.rs b/src/providers/node/mod.rs --- a/src/providers/node/mod.rs +++ b/src/providers/node/mod.rs @@ -692,7 +693,7 @@ mod test { } #[test] - fn test_find_next_pacakges() -> Result<()> { + fn test_find_next_packages() -> Result<()> { assert_eq!( No...
Various path-related errors on Windows ### Is there an existing issue for this? - [X] I have searched the existing issues ### Describe the bug Things break on Windows because nobody bothered to test for it. ### To reproduce `cargo test` ### Expected behavior it works :) ### Environment Windows lol
Can you please share the actual bugs/errors that occur. The main environment that Nixpacks is used in is Linux and unix-like system, which is why Windows compatibility has not been a priority. I am happy to accept PRs that improve Windows support, but issues that have no error messages or examples are not very useful. ...
2022-08-24T02:34:48
0.3
0010fbcfc812ce3588204f805dba01e7546f502b
[ "clojure", "clojure_ring_app", "clojure_jdk_latest", "clojure_jdk11" ]
[ "nixpacks::app::tests::test_creates_app", "nixpacks::app::tests::test_read_file", "nixpacks::app::tests::test_read_json_file", "nixpacks::app::tests::test_static_asset_path", "nixpacks::app::tests::test_read_structured_json_file", "nixpacks::app::tests::test_strip_source_path", "nixpacks::builder::docke...
[ "test_django", "test_deno", "test_cowsay", "test_go", "test_clojure", "test_fsharp", "test_csharp", "test_bun", "test_clojure_ring_app", "test_go_custom_version", "test_dart", "test_bun_web_server", "test_crystal", "test_node_custom_version", "test_node_canvas", "test_node", "test_ja...
[]
104
2022-08-25T01:55:44Z
railwayapp/nixpacks
163
railwayapp__nixpacks-163
[ "77" ]
29e0376894527e923434cb88679bcd3067b4901d
diff --git /dev/null b/examples/staticfile/Staticfile new file mode 100644 --- /dev/null +++ b/examples/staticfile/Staticfile @@ -0,0 +1,1 @@ +root: /app/site \ No newline at end of file diff --git /dev/null b/examples/staticfile/Staticfile.auth new file mode 100644 --- /dev/null +++ b/examples/staticfile/Staticfile.au...
diff --git a/tests/docker_run_tests.rs b/tests/docker_run_tests.rs --- a/tests/docker_run_tests.rs +++ b/tests/docker_run_tests.rs @@ -6,7 +6,7 @@ use nixpacks::{ plan::generator::GeneratePlanOptions, }, }; -use serde_json::json; + use std::io::{BufRead, BufReader}; use std::process::{Command, Stdio}; ...
Staticfile/HTML provider
How would this work? Can detect using a specific variable/file (that provides more config options) or maybe if everything fails and it has `index.html` in root I don't think this is a good idea. Setting up a web server isn't hard. Some people find setting up a production ready server difficult. Adding a variable is muc...
2022-06-02T20:23:00
0.0
59ba5914e411b778b015da4bb6374826ffc16825
[ "test_staticfile" ]
[ "nixpacks::app::tests::test_find_files", "nixpacks::app::tests::test_creates_app", "nixpacks::nix::pkg::tests::test_pkg_single_override_to_string", "nixpacks::app::tests::test_read_structured_json_file", "nixpacks::environment::tests::test_create_invalid_environment", "nixpacks::environment::tests::test_e...
[ "test_django", "test_cowsay", "test_pnpm", "test_rust_custom_version", "test_yarn_prisma", "test_python_2" ]
[]
105
2022-06-02T21:42:35Z
railwayapp/nixpacks
107
railwayapp__nixpacks-107
[ "100" ]
57905fd81c8006b00a95f19b234dfaa066ce141f
diff --git /dev/null b/examples/csharp-api/Controllers/WeatherForecastController.cs new file mode 100644 --- /dev/null +++ b/examples/csharp-api/Controllers/WeatherForecastController.cs @@ -0,0 +1,32 @@ +using Microsoft.AspNetCore.Mvc; + +namespace csharp.Controllers; + +[ApiController] +[Route("[controller]")] +public...
diff --git a/tests/docker_run_tests.rs b/tests/docker_run_tests.rs --- a/tests/docker_run_tests.rs +++ b/tests/docker_run_tests.rs @@ -279,6 +279,13 @@ fn test_pnpm_custom_version() { assert!(output.contains("Hello from PNPM")); } +#[test] +fn test_csharp() { + let name = simple_build("./examples/csharp-cli"...
C# Provider Part of #84
2022-05-12T07:12:49
0.0
59ba5914e411b778b015da4bb6374826ffc16825
[ "test_csharp_cli", "test_csharp_api" ]
[ "nixpacks::app::tests::test_creates_app", "nixpacks::app::tests::test_read_file", "nixpacks::app::tests::test_read_structured_json_file", "nixpacks::app::tests::test_read_json_file", "nixpacks::app::tests::test_strip_source_path", "nixpacks::app::tests::test_strip_source_path_no_source_prefix", "nixpack...
[ "test_django", "test_csharp", "test_cowsay", "test_python_2", "test_pnpm", "test_yarn_prisma", "test_rust_custom_version" ]
[]
106
2022-06-02T23:07:55Z
rust-bakery/nom
1,032
rust-bakery__nom-1032
[ "1027" ]
c326e077b83c62f81b717c80a281cb453cb914e7
diff --git a/src/error.rs b/src/error.rs --- a/src/error.rs +++ b/src/error.rs @@ -187,7 +187,11 @@ pub fn convert_error(input: &str, e: VerboseError<&str>) -> crate::lib::std::str result += &repeat(' ').take(column).collect::<crate::lib::std::string::String>(); } result += "^\n"; - ...
diff --git a/src/error.rs b/src/error.rs --- a/src/error.rs +++ b/src/error.rs @@ -535,7 +539,6 @@ macro_rules! flat_map( ); ); - #[cfg(test)] #[cfg(feature = "alloc")] mod tests { diff --git a/src/error.rs b/src/error.rs --- a/src/error.rs +++ b/src/error.rs @@ -547,6 +550,13 @@ mod tests { let input = "...
Option::unwrap() on a None value, in src/error.rs:190 ## Prerequisites Here are a few things you should provide to help me understand the issue: - Rust version : `rustc 1.37.0 (eae3437df 2019-08-13)` - nom version : `5.0.1` - nom compilation features used: [the default, I haven't modified any] ## Test case ...
I just ran into the same issue. It's not looking for the newline I think, but rather it's trying to report "expected char x, found char y", but there is no `y`. it should probably do something like `unwrap_or("<EOF>")`.
2019-09-14T04:38:07
5.0
c326e077b83c62f81b717c80a281cb453cb914e7
[ "issue_1027_convert_error_panic_nonempty" ]
[ "bits::macros::tests::bits_bytes", "bits::macros::tests::take_bits", "bits::macros::tests::chain_bits", "bits::macros::tests::bits_to_bytes", "bits::macros::tests::tag_bits", "branch::macros::tests::alt_incomplete", "bits::macros::tests::non_privitive_type", "branch::macros::tests::alt", "branch::ma...
[ "internal::tests::size_test" ]
[]
107
2020-01-07T16:43:33Z
nushell/nushell
11,030
nushell__nushell-11030
[ "10908" ]
588a078872318d6db0530fbb9accd987560dbbde
diff --git a/crates/nu-parser/src/deparse.rs b/crates/nu-parser/src/deparse.rs --- a/crates/nu-parser/src/deparse.rs +++ b/crates/nu-parser/src/deparse.rs @@ -1,3 +1,10 @@ +fn string_should_be_quoted(input: &str) -> bool { + input.starts_with('$') + || input + .chars() + .any(|c| c == ' ...
diff --git a/crates/nu-parser/src/deparse.rs b/crates/nu-parser/src/deparse.rs --- a/crates/nu-parser/src/deparse.rs +++ b/crates/nu-parser/src/deparse.rs @@ -55,15 +57,28 @@ mod test { #[test] fn test_not_extra_quote() { // check for input arg like this: - // nu b.nu 8 + // nu b.nu wor...
String script args with parenthesis are mangled ### Describe the bug Passing string args with parenthesis to a nushell script can cause the args to be mangled. ### How to reproduce example `echo.nu` script: ```nushell #!/usr/bin/env nu def main [input: string] { print $input } ``` here's how it beha...
good catch @pcrock-thmdo i couldn't reproduce this in the REPL nor as a module, so i'd say it's an issue with Nushell scripts, not custom commands or modules :ok_hand: I experimented with it and interestingly `./echo.nu "hi (1)"` works as expected. The difference between calling it directly and in a script from wh...
2023-11-11T23:55:32
0.86
588a078872318d6db0530fbb9accd987560dbbde
[ "deparse::test::test_flag_arg_with_values_contains_special", "deparse::test::test_quote_special" ]
[ "deparse::test::test_arg_with_flag", "deparse::test::test_escape", "deparse::test::test_not_extra_quote", "lex_annotations_empty", "lex_annotations_list", "lex_annotations_nested", "lex_annotations_nested_unterminated", "lex_annotations_record", "lex_annotations_space_before_annotations", "lex_ann...
[]
[]
108
2024-02-03T15:35:28Z
nushell/nushell
11,008
nushell__nushell-11008
[ "10973" ]
cd75640a90d5166ee529a8c1c49eb9d2ab34253a
diff --git a/crates/nu-cli/src/completions/completer.rs b/crates/nu-cli/src/completions/completer.rs --- a/crates/nu-cli/src/completions/completer.rs +++ b/crates/nu-cli/src/completions/completer.rs @@ -141,18 +141,24 @@ impl NuCompleter { let current_span = working_set.get_span_contents(fl...
diff --git a/crates/nu-cli/tests/completions.rs b/crates/nu-cli/tests/completions.rs --- a/crates/nu-cli/tests/completions.rs +++ b/crates/nu-cli/tests/completions.rs @@ -59,6 +59,29 @@ fn extern_completer() -> NuCompleter { NuCompleter::new(std::sync::Arc::new(engine), stack) } +#[fixture] +fn custom_completer...
unexpected external_completer spans value ### Describe the bug Unexpected completer spans value when triggering completion in the middle of a command line. ``` cmd foo ▮bar ``` In `let external_completer = {|spans| ...}` , `$spans` value is `["cmd", "foo" "a"]` ### How to reproduce 1. Create a `c...
2023-11-09T12:18:24
0.86
588a078872318d6db0530fbb9accd987560dbbde
[ "custom_completer_triggers_cursor_before_word", "custom_completer_triggers_cursor_on_word_left_boundary" ]
[ "command_open_with_filecompletion", "command_rm_with_globcompletion", "command_ls_with_filecompletion", "command_touch_with_filecompletion", "alias_of_command_and_flags", "alias_of_basic_command", "command_cp_with_globcompletion", "command_save_with_filecompletion", "alias_of_another_alias", "comm...
[]
[]
109
2023-12-16T20:23:10Z
nushell/nushell
6,129
nushell__nushell-6129
[ "6113" ]
e4e27b6e11ea45ef413998c58f679427f03716a7
diff --git a/crates/nu-protocol/src/pipeline_data.rs b/crates/nu-protocol/src/pipeline_data.rs --- a/crates/nu-protocol/src/pipeline_data.rs +++ b/crates/nu-protocol/src/pipeline_data.rs @@ -460,12 +460,12 @@ impl PipelineData { match engine_state.find_decl("table".as_bytes(), &[]) { Some(decl_i...
diff --git a/src/tests/test_custom_commands.rs b/src/tests/test_custom_commands.rs --- a/src/tests/test_custom_commands.rs +++ b/src/tests/test_custom_commands.rs @@ -130,3 +130,8 @@ fn help_not_present_in_extern() -> TestResult { "Usage:\n > git fetch", ) } + +#[test] +fn override_table() -> TestResult...
Error when creating a custom command named "table" ### Describe the bug When running ``` def table [] {"hi"} ``` I get ``` Error: × Internal error: can't run custom command with 'run', use block_id ``` and after that any other command I run returns the same error. ### How to reproduce 1. Create a custom...
2022-07-26T06:50:27
0.65
e4e27b6e11ea45ef413998c58f679427f03716a7
[ "tests::test_custom_commands::override_table" ]
[ "tests::test_conditionals::if_cond", "tests::test_conditionals::if_cond2", "tests::test_conditionals::if_test2", "tests::test_conditionals::if_test1", "tests::test_conditionals::simple_if2", "tests::test_conditionals::if_cond4", "tests::test_conditionals::if_elseif1", "tests::test_conditionals::if_els...
[]
[]
110
2022-07-26T00:39:15Z
nushell/nushell
5,932
nushell__nushell-5932
[ "5931" ]
3917fda7ed861cd6d1851186dc40974df540fc3a
diff --git a/crates/nu-command/src/formats/to/md.rs b/crates/nu-command/src/formats/to/md.rs --- a/crates/nu-command/src/formats/to/md.rs +++ b/crates/nu-command/src/formats/to/md.rs @@ -291,7 +296,7 @@ fn get_output_string( } for i in 0..row.len() { - if pretty { + if pretty &...
diff --git a/crates/nu-command/src/formats/to/md.rs b/crates/nu-command/src/formats/to/md.rs --- a/crates/nu-command/src/formats/to/md.rs +++ b/crates/nu-command/src/formats/to/md.rs @@ -54,6 +54,11 @@ impl Command for ToMd { "# Welcome to Nushell\n| foo | bar |\n| --- | --- |\n| 1 | 2 |", ...
`to md --pretty` panics when rendering a list ### Describe the bug ``` thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', crates/nu-command/src/formats/to/md.rs:296:75 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` ### How to reproduce 1. [0 1 2] |...
2022-07-02T20:09:34
0.64
3917fda7ed861cd6d1851186dc40974df540fc3a
[ "formats::to::md::tests::test_examples" ]
[ "charting::hashable_value::test::put_to_hashset", "charting::hashable_value::test::hashable_value_eq_without_concern_span", "charting::hashable_value::test::from_to_tobe_same", "charting::hashable_value::test::from_value", "charting::hashable_value::test::from_unhashable_value", "conversions::into::dateti...
[ "commands::append::adds_a_row_to_the_end", "commands::alias::alias_simple", "commands::all::checks_all_rows_are_true", "commands::all::checks_all_rows_are_false_with_param", "commands::any::checks_any_row_is_true", "commands::any::checks_any_column_of_a_table_is_true", "commands::all::checks_all_rows_ar...
[]
111
2022-07-02T12:52:18Z
nushell/nushell
5,779
nushell__nushell-5779
[ "5776" ]
fe88d58b1ed4cb77fedea9fcad71afb54af6ba90
diff --git a/crates/nu-command/src/strings/build_string.rs b/crates/nu-command/src/strings/build_string.rs --- a/crates/nu-command/src/strings/build_string.rs +++ b/crates/nu-command/src/strings/build_string.rs @@ -39,7 +39,7 @@ impl Command for BuildString { }), }, Example { ...
diff --git a/crates/nu-parser/tests/test_parser.rs b/crates/nu-parser/tests/test_parser.rs --- a/crates/nu-parser/tests/test_parser.rs +++ b/crates/nu-parser/tests/test_parser.rs @@ -929,6 +929,45 @@ mod input_types { } } + #[derive(Clone)] + pub struct IfMocked; + + impl Command for IfMocked {...
Weird bug of "Types mismatched for `||` operation" ### Describe the bug Weird bug of "Types mismatched for `||` operation" ### How to reproduce ```shell # foo.nu def 'check' [ type?: string, ] { let cond1 = ($type == $nothing) let cond2 = (($type in ['added' 'deleted' 'commits']) == false) print...
A more simpler case: ```shell let a = 'b' # This line works if $a == 'b' || $a == 'c' { echo 'b or c' } else { echo 'other' } # This line failed if ($a == 'b') || ($a == 'c') { echo 'b or c' } else { echo 'other' } ``` I think it's a regression, it used to work before. I ran into this error yesterday as well run...
2022-06-15T04:07:51
0.63
fe88d58b1ed4cb77fedea9fcad71afb54af6ba90
[ "input_types::operations_within_blocks_test" ]
[ "parse_binary_with_binary_format", "parse_binary_with_hex_format", "parse_binary_with_incomplete_binary_format", "parse_binary_with_incomplete_hex_format", "input_types::call_non_custom_types_test", "input_types::call_types_test", "parse_binary_with_incomplete_octal_format", "input_types::nested_opera...
[]
[]
112
2022-06-15T01:31:15Z
nushell/nushell
5,137
nushell__nushell-5137
[ "4459" ]
0892a16a3d046c401df4b3691286d3c0d9524484
diff --git a/crates/nu-command/src/filters/collect.rs b/crates/nu-command/src/filters/collect.rs --- a/crates/nu-command/src/filters/collect.rs +++ b/crates/nu-command/src/filters/collect.rs @@ -1,7 +1,9 @@ use nu_engine::{eval_block, CallExt}; use nu_protocol::ast::Call; use nu_protocol::engine::{CaptureBlock, Comm...
diff --git a/crates/nu-command/tests/main.rs b/crates/nu-command/tests/main.rs --- a/crates/nu-command/tests/main.rs +++ b/crates/nu-command/tests/main.rs @@ -19,7 +19,7 @@ fn quickcheck_parse(data: String) -> bool { let mut working_set = StateWorkingSet::new(&context); working_set.add_file("q...
`$in` variable not found in definition ### Describe the bug `$in` is not found inside definitions in some circumastances. ### How to reproduce ``` > def shl [] { $in * 2 } > 2 | shl Error: nu::shell::variable_not_found (https://docs.rs/nu-protocol/0.59.0/nu-protocol/enum.ShellError.html#variant.VariableN...
2022-04-09T04:16:32
0.60
0892a16a3d046c401df4b3691286d3c0d9524484
[ "tests::test_engine::in_means_input", "tests::test_engine::in_iteration", "tests::test_engine::loose_each", "tests::test_engine::reuseable_in" ]
[ "tests::test_conditionals::if_cond4", "tests::test_conditionals::if_elseif2", "tests::test_conditionals::if_cond2", "tests::test_conditionals::if_test2", "tests::test_conditionals::if_cond3", "tests::test_conditionals::if_elseif3", "tests::test_conditionals::if_elseif1", "tests::test_conditionals::if_...
[ "path::canonicalize::canonicalize_ndots" ]
[]
113
2022-04-08T21:41:08Z
nushell/nushell
10,405
nushell__nushell-10405
[ "9702" ]
bc7736bc9965d2df2e406f0e4fe9f4fe0d8c29f7
diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -3083,10 +3083,22 @@ pub fn parse_var_with_opt_type( if bytes.ends_with(b":") { // We end with colon, so the next span should be the type if *s...
diff --git a/crates/nu-parser/tests/test_parser.rs b/crates/nu-parser/tests/test_parser.rs --- a/crates/nu-parser/tests/test_parser.rs +++ b/crates/nu-parser/tests/test_parser.rs @@ -1354,6 +1354,38 @@ mod input_types { } } + #[derive(Clone)] + pub struct Def; + + impl Command for Def { + ...
cannot specify fields and columns in record and table i/o type annotations ### Describe the bug i wanted to write some interesting commands to play with the new features from the input/output type annotations. we can use `table` and `record` but the parser is not happy when we try to specify the types of columns and ...
I see what you're saying. I haven't tried but I wonder if lists work. It looks like the latest changes may not follow @1Kinoti's PRs enabled this type of thing for parameters. records https://github.com/nushell/nushell/pull/8914 lists https://github.com/nushell/nushell/pull/8529 tables https://github.com/nushell...
2023-09-18T04:49:17
0.84
bc7736bc9965d2df2e406f0e4fe9f4fe0d8c29f7
[ "input_types::test_type_annotations::case_05_input_output", "input_types::test_type_annotations::case_06_input_output", "input_types::test_type_annotations::case_07_input_output", "input_types::test_type_annotations::case_16_vardecl", "input_types::test_type_annotations::case_18_vardecl", "input_types::te...
[ "input_types::call_non_custom_types_test", "input_types::test_type_annotations::case_03_input_output", "input_types::else_if_errors_correctly", "input_types::test_type_annotations::case_01_input_output", "input_types::test_type_annotations::case_02_input_output", "input_types::test_type_annotations::case_...
[ "path::canonicalize::canonicalize_ndots" ]
[]
115
2023-09-25T18:49:57Z
nushell/nushell
9,722
nushell__nushell-9722
[ "9556" ]
a5a79a7d95822bc143090612e1813f3b06befbf4
diff --git a/crates/nu_plugin_formats/src/from/ini.rs b/crates/nu_plugin_formats/src/from/ini.rs --- a/crates/nu_plugin_formats/src/from/ini.rs +++ b/crates/nu_plugin_formats/src/from/ini.rs @@ -24,7 +24,10 @@ pub fn from_ini_call(call: &EvaluatedCall, input: &Value) -> Result<Value, Label sect...
diff --git a/tests/plugins/formats/ini.rs b/tests/plugins/formats/ini.rs --- a/tests/plugins/formats/ini.rs +++ b/tests/plugins/formats/ini.rs @@ -10,10 +10,13 @@ fn parses_ini() { let actual = nu_with_plugins!( cwd: TEST_CWD, plugin: ("nu_plugin_formats"), - "open sample.ini | get Section...
From ini adds additional empty record to structured output ### Describe the bug Opening an ini-formatted file and parsing it via `from ini` adds another empty key/value pair to the record ### How to reproduce 1. Save attached ini file as whatever 2. Run `open whatever|from ini` 3. Notice additional record key ###...
i wonder if this is a problem with the ini crate or with our code?
2023-07-18T05:33:13
0.82
a5a79a7d95822bc143090612e1813f3b06befbf4
[ "plugins::formats::ini::parses_ini" ]
[ "tests::test_bits::bits_and_list", "tests::test_bits::bits_or_list", "tests::test_bits::bits_and", "tests::test_bits::bits_and_negative", "tests::test_bits::bits_rotate_left", "tests::test_bits::bits_rotate_right_negative", "tests::test_bits::bits_rotate_right", "tests::test_bits::bits_rotate_left_lis...
[ "path::canonicalize::canonicalize_ndots" ]
[]
116
2023-07-19T08:45:21Z
nushell/nushell
9,502
nushell__nushell-9502
[ "9501" ]
b74d508c0bdf2fb60e21ae77f11c12eb418862cf
diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -11,8 +11,9 @@ use crate::ast::{Math, Operator}; use crate::engine::EngineState; use crate::ShellError; use crate::{did_you_mean, BlockId, Conf...
diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -3889,4 +3899,44 @@ mod tests { ); } } + + mod into_string { + use chrono::{DateTime, FixedOffset, NaiveDateT...
displaying BC datetime causes panic ### Describe the bug A BC datetime can be calculated and stored in a variable, but trying to display it kills nushell with a panic. ### How to reproduce ```shell $ nu > 0000-01-02 Sun, 02 Jan 0000 00:00:00 +0000 (2024 years ago) > 0000-01-02 - 1day Sat, 01 Jan 0000 ...
good catch :+1:
2023-06-22T07:22:15
0.81
b74d508c0bdf2fb60e21ae77f11c12eb418862cf
[ "value::tests::into_string::test_negative_year_datetime" ]
[ "ty::tests::subtype_relation::test_any_is_top_type", "engine::engine_state::engine_state_tests::add_file_gives_id_including_parent", "engine::engine_state::engine_state_tests::add_file_gives_id", "engine::engine_state::engine_state_tests::list_variables", "ty::tests::subtype_relation::test_number_supertype"...
[ "config_add_unsupported_key", "config_add_unsupported_type", "config_add_unsupported_value", "config_affected_when_deep_mutated", "config_affected_when_mutated", "config_is_mutable", "config_preserved_after_do", "filesize_format_auto_metric_false", "filesize_metric_false", "filesize_format_auto_me...
[]
117
2023-06-26T16:21:14Z
nushell/nushell
14,475
nushell__nushell-14475
[ "14462" ]
49fb5cb1a8103268d3ac519752ffc2ded1987a98
diff --git a/crates/nu-command/src/filters/length.rs b/crates/nu-command/src/filters/length.rs --- a/crates/nu-command/src/filters/length.rs +++ b/crates/nu-command/src/filters/length.rs @@ -19,6 +19,7 @@ impl Command for Length { .input_output_types(vec![ (Type::List(Box::new(Type::Any)),...
diff --git a/crates/nu-command/src/filters/length.rs b/crates/nu-command/src/filters/length.rs --- a/crates/nu-command/src/filters/length.rs +++ b/crates/nu-command/src/filters/length.rs @@ -54,6 +55,11 @@ impl Command for Length { example: "0x[01 02] | length", result: Some(Value::tes...
`sort-by {length}` on list of strings doesn't result in error ### Describe the bug The following should result in a type error, or at least a runtime error: ``` ["hello" "bye"] | sort-by {length} ``` Because `length` cannot be applied on strings. Worse, it just silently returns the original list, making the...
Looks like `length` has input/output type set correct so we get a parser error, but no run-time check so you can launder a value through `any`. Should be a simple fix in `length`. Ex: ```nushell "hi" | length Error: nu::parser::input_type_mismatch × Command does not support string input. ╭─[entry #2:1:8]...
2024-11-30T03:06:07
1.80
49fb5cb1a8103268d3ac519752ffc2ded1987a98
[ "filters::length::test::test_examples" ]
[ "charting::hashable_value::test::from_unhashable_value", "charting::hashable_value::test::from_to_tobe_same", "charting::hashable_value::test::from_value", "charting::hashable_value::test::put_to_hashset", "charting::hashable_value::test::hashable_value_eq_without_concern_span", "charting::histogram::test...
[ "debug::timeit::test_time_block", "debug::timeit::test_time_block_2", "strings::split::words::test::mixed_letter_number", "strings::split::words::test::test_incompat_flags", "strings::split::words::test::test_incompat_flags_2", "commands::alias::alias_multiword_name", "commands::alias::alias_default_hel...
[]
118
2024-11-30T02:00:13Z
nushell/nushell
14,095
nushell__nushell-14095
[ "13757", "9562" ]
b99affba4b42a678b3ecdb58b6c206d75cefc317
diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -4603,7 +4603,7 @@ pub fn parse_closure_expression( } = token.1 { end_span = Some(span); - a...
diff --git a/tests/repl/test_signatures.rs b/tests/repl/test_signatures.rs --- a/tests/repl/test_signatures.rs +++ b/tests/repl/test_signatures.rs @@ -1,4 +1,5 @@ use crate::repl::tests::{fail_test, run_test, TestResult}; +use rstest::rstest; #[test] fn list_annotations() -> TestResult { diff --git a/tests/repl/te...
malformed closures don't error out ### Describe the bug A closure should look like this ```nushell # empty closure { || } # closure with (an) argument(s) { |a| } { |a, b| } # closure with a body { |a, b| $a + $b } ``` However, leaving out the second pipe symbol `|` doesn't error out although I thi...
That flaw in the parser seems to be having a secondary effect in the AST flattening for syntax highlighting: - #9562 good catch @haoming-li-ling :ok_hand: I can't reproduce it with 0.96: ![image](https://github.com/user-attachments/assets/66f3d738-c062-43d3-8afd-ac65b05c3ac0) With my color scheme it appears still...
2024-10-16T02:52:56
1.79
91ff57faa7921223fe54b3cfca2e324d36c7018d
[ "repl::test_signatures::closure_param_list_not_terminated::case_2", "repl::test_signatures::closure_param_list_not_terminated::case_1", "repl::test_signatures::closure_param_list_not_terminated::case_3", "repl::test_signatures::closure_param_list_not_terminated::case_4" ]
[ "const_::const_binary_operator::case_01", "const_::const_binary", "const_::const_binary_operator::case_02", "const_::const_binary_operator::case_06", "const_::const_binary_operator::case_05", "const_::const_binary_operator::case_03", "const_::const_binary_operator::case_07", "const_::const_binary_oper...
[ "plugin_persistence::plugin_process_exits_when_nushell_exits" ]
[]
119
2024-10-22T16:38:51Z
nushell/nushell
14,074
nushell__nushell-14074
[ "13654" ]
91ff57faa7921223fe54b3cfca2e324d36c7018d
diff --git a/crates/nu-command/src/conversions/into/value.rs b/crates/nu-command/src/conversions/into/value.rs --- a/crates/nu-command/src/conversions/into/value.rs +++ b/crates/nu-command/src/conversions/into/value.rs @@ -18,7 +18,7 @@ impl Command for IntoValue { .input_output_types(vec![(Type::table(), ...
diff --git a/tests/repl/test_custom_commands.rs b/tests/repl/test_custom_commands.rs --- a/tests/repl/test_custom_commands.rs +++ b/tests/repl/test_custom_commands.rs @@ -1,6 +1,7 @@ use crate::repl::tests::{fail_test, run_test, run_test_contains, TestResult}; use nu_test_support::nu; use pretty_assertions::assert_e...
Inconsistent behavior when passing null using long and shorthand flag parameter ### Describe the bug When passing null to a custom command that have a flag parameter defined of type string the behavior is different if the long version or shorthand version of the flag is used. ### How to reproduce 1. Define a command...
2024-10-13T05:19:19
1.79
91ff57faa7921223fe54b3cfca2e324d36c7018d
[ "repl::test_custom_commands::custom_flag_with_type_checking::type_sig_value_1____int_______3_____::flag_2____d__", "repl::test_custom_commands::custom_flag_with_type_checking::type_sig_value_2____int_____null___::flag_2____d__", "repl::test_custom_commands::custom_flag_with_type_checking::type_sig_value_3____re...
[ "const_::const_binary_operator::case_03", "const_::const_binary_operator::case_02", "const_::const_binary_operator::case_04", "const_::const_binary_operator::case_05", "const_::const_binary", "const_::const_binary_operator::case_07", "const_::const_binary_operator::case_01", "const_::const_binary_oper...
[]
[ "plugin_persistence::plugin_process_exits_when_nushell_exits" ]
120
2024-10-18T01:19:29Z